Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2] avcodec/h264chroma_template: Replace variable by constant in chroma mc
@ 2025-07-19 22:37 Michael Niedermayer
  0 siblings, 0 replies; only message in thread
From: Michael Niedermayer @ 2025-07-19 22:37 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

The chroma MC is implemented in 3 cases, the first
takes care of the case where the 4 bilinear coefficients are non zero
the next takes care of the case where 2 are non zero and the last
considers the case where 3 coefficients are 0.
The last case implies that the remaining coefficient is 64

This patch makes that explicit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/h264chroma_template.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/libavcodec/h264chroma_template.c b/libavcodec/h264chroma_template.c
index b9d24f5a0cd..b20811a71ae 100644
--- a/libavcodec/h264chroma_template.c
+++ b/libavcodec/h264chroma_template.c
@@ -54,7 +54,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst /*align 8*/, const ui
         }\
     } else {\
         for(i=0; i<h; i++){\
-            OP(dst[0], (A*src[0]));\
+            OP(dst[0], (64*src[0]));\
             dst+= stride;\
             src+= stride;\
         }\
@@ -91,8 +91,8 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, const ui
         }\
     } else {\
         for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
+            OP(dst[0], 64 * src[0]);\
+            OP(dst[1], 64 * src[1]);\
             dst += stride;\
             src += stride;\
         }\
@@ -134,10 +134,10 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, const ui
         }\
     } else {\
         for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
-            OP(dst[2], A * src[2]);\
-            OP(dst[3], A * src[3]);\
+            OP(dst[0], 64 * src[0]);\
+            OP(dst[1], 64 * src[1]);\
+            OP(dst[2], 64 * src[2]);\
+            OP(dst[3], 64 * src[3]);\
             dst += stride;\
             src += stride;\
         }\
@@ -187,14 +187,14 @@ static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, const ui
         }\
     } else {\
         for ( i = 0; i < h; i++){\
-            OP(dst[0], A * src[0]);\
-            OP(dst[1], A * src[1]);\
-            OP(dst[2], A * src[2]);\
-            OP(dst[3], A * src[3]);\
-            OP(dst[4], A * src[4]);\
-            OP(dst[5], A * src[5]);\
-            OP(dst[6], A * src[6]);\
-            OP(dst[7], A * src[7]);\
+            OP(dst[0], 64 * src[0]);\
+            OP(dst[1], 64 * src[1]);\
+            OP(dst[2], 64 * src[2]);\
+            OP(dst[3], 64 * src[3]);\
+            OP(dst[4], 64 * src[4]);\
+            OP(dst[5], 64 * src[5]);\
+            OP(dst[6], 64 * src[6]);\
+            OP(dst[7], 64 * src[7]);\
             dst += stride;\
             src += stride;\
         }\
-- 
2.49.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-19 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-19 22:37 [FFmpeg-devel] [PATCH v2] avcodec/h264chroma_template: Replace variable by constant in chroma mc Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git