summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2025-06-13 03:04:45 +0200
committerAndreas Rheinhardt <[email protected]>2025-06-21 22:08:52 +0200
commit70ce68d0212f7c1fd9b453fa203371dba05fb3af (patch)
treea85ed94514249045ed1c51e1f2ee4e57a760f3dd
parentdcd7408c9200464bc33293b96f439121af2dd692 (diff)
avcodec/mpegvideo: Don't reset AC values of upper-left luma block
Said block will only be referenced by blocks from the same macroblock, which will read the new AC values instead of the reset values from this function. Signed-off-by: Andreas Rheinhardt <[email protected]>
-rw-r--r--libavcodec/mpegvideo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index a27efa8b89..b481d1eef4 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -506,7 +506,9 @@ void ff_clean_intra_table_entries(MpegEncContext *s)
/* ac pred */
int16_t (*ac_val)[16] = s->ac_val[0];
av_assume(!((uintptr_t)ac_val & 0xF));
- memset(ac_val[xy ], 0, 2 * sizeof(*ac_val));
+ // Don't reset the upper-left luma block, as it will only ever be
+ // referenced by blocks from the same macroblock.
+ memset(ac_val[xy + 1], 0, sizeof(*ac_val));
memset(ac_val[xy + wrap], 0, 2 * sizeof(*ac_val));
/* ac pred */
memset(ac_val[uxy], 0, sizeof(*ac_val));