Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <ffmpegagent-at-gmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 41/47] avcodec/vc1: Only keep mb_type[0]
Date: Sun, 15 Jun 2025 16:54:32 +0000
Message-ID: <2123ccc08065efc9cb2d70f3d2e65d833295a479.1750006480.git.ffmpegagent@gmail.com> (raw)
In-Reply-To: <pull.98.ffstaging.FFmpeg.1750006478.ffmpegagent@gmail.com>

From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

The chroma mb_type[1] and mb_type[2] pointers are unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/vc1.h            |  2 +-
 libavcodec/vc1_block.c      | 96 ++++++++++++++++++-------------------
 libavcodec/vc1_loopfilter.c | 10 ++--
 libavcodec/vc1_mc.c         |  8 ++--
 libavcodec/vc1_pred.c       | 14 +++---
 libavcodec/vc1dec.c         |  4 +-
 6 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h
index da82124a5e..992c073cdc 100644
--- a/libavcodec/vc1.h
+++ b/libavcodec/vc1.h
@@ -263,7 +263,7 @@ typedef struct VC1Context{
     int codingset2;          ///< index of current table set from 11.8 to use for chroma block decoding
     int pqindex;             ///< raw pqindex used in coding set selection
     int a_avail, c_avail;
-    uint8_t *mb_type_base, *mb_type[3];
+    uint8_t *mb_type_base, *mb_type;
 
 
     /** Luma compensation parameters */
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 9302c12c71..f73a9a8898 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -90,8 +90,8 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed)
     if (!s->first_slice_line && v->fcm != ILACE_FRAME) {
         if (s->mb_x) {
             for (i = 0; i < block_count; i++) {
-                if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i] - 1] :
-                            v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i] - 2]) {
+                if (i > 3 ? v->mb_type[s->block_index[i] - s->block_wrap[i] - 1] :
+                            v->mb_type[s->block_index[i] - 2 * s->block_wrap[i] - 2]) {
                     dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + ((i & 1) - 2) * 8;
                     if (put_signed)
                         s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][block_map[i]],
@@ -106,8 +106,8 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed)
         }
         if (s->mb_x == v->end_mb_x - 1) {
             for (i = 0; i < block_count; i++) {
-                if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i]] :
-                            v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i]]) {
+                if (i > 3 ? v->mb_type[s->block_index[i] - s->block_wrap[i]] :
+                            v->mb_type[s->block_index[i] - 2 * s->block_wrap[i]]) {
                     dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + (i & 1) * 8;
                     if (put_signed)
                         s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][block_map[i]],
@@ -126,8 +126,8 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed)
             if (v->fcm == ILACE_FRAME)
                 fieldtx = v->fieldtx_plane[s->mb_y * s->mb_stride + s->mb_x - 1];
             for (i = 0; i < block_count; i++) {
-                if (i > 3 ? v->mb_type[0][s->block_index[i] - 1] :
-                            v->mb_type[0][s->block_index[i] - 2]) {
+                if (i > 3 ? v->mb_type[s->block_index[i] - 1] :
+                            v->mb_type[s->block_index[i] - 2]) {
                     if (fieldtx)
                         dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + ((i & 1) - 2) * 8;
                     else
@@ -147,7 +147,7 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed)
             if (v->fcm == ILACE_FRAME)
                 fieldtx = v->fieldtx_plane[s->mb_y * s->mb_stride + s->mb_x];
             for (i = 0; i < block_count; i++) {
-                if (v->mb_type[0][s->block_index[i]]) {
+                if (v->mb_type[s->block_index[i]]) {
                     if (fieldtx)
                         dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + (i & 1) * 8;
                     else
@@ -1290,7 +1290,7 @@ static int vc1_decode_p_mb(VC1Context *v)
                 s->cur_pic.motion_val[1][s->block_index[0]][1] = 0;
             }
             s->cur_pic.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16;
-            ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
+            ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type, 0, 0);
 
             /* FIXME Set DC val for inter block ? */
             if (s->mb_intra && !mb_has_coeffs) {
@@ -1318,14 +1318,14 @@ static int vc1_decode_p_mb(VC1Context *v)
                 dst_idx += i >> 2;
                 val = ((cbp >> (5 - i)) & 1);
                 off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-                v->mb_type[0][s->block_index[i]] = s->mb_intra;
+                v->mb_type[s->block_index[i]] = s->mb_intra;
                 if (s->mb_intra) {
                     /* check if prediction blocks A and C are available */
                     v->a_avail = v->c_avail = 0;
                     if (i == 2 || i == 3 || !s->first_slice_line)
-                        v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                        v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
                     if (i == 1 || i == 3 || s->mb_x)
-                        v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                        v->c_avail = v->mb_type[s->block_index[i] - 1];
 
                     ret = vc1_decode_intra_block(v, v->block[v->cur_blk_idx][block_map[i]], i, val, mquant,
                                                  (i & 4) ? v->codingset2 : v->codingset);
@@ -1354,12 +1354,12 @@ static int vc1_decode_p_mb(VC1Context *v)
         } else { // skipped
             s->mb_intra = 0;
             for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
+                v->mb_type[s->block_index[i]] = 0;
                 s->dc_val[s->block_index[i]]  = 0;
             }
             s->cur_pic.mb_type[mb_pos]      = MB_TYPE_SKIP;
             s->cur_pic.qscale_table[mb_pos] = 0;
-            ff_vc1_pred_mv(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
+            ff_vc1_pred_mv(v, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type, 0, 0);
             ff_vc1_mc_1mv(v, 0);
         }
     } else { // 4MV mode
@@ -1379,7 +1379,7 @@ static int vc1_decode_p_mb(VC1Context *v)
                     if (val) {
                         GET_MVDATA(dmv_x, dmv_y);
                     }
-                    ff_vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], 0, 0);
+                    ff_vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type, 0, 0);
                     if (!s->mb_intra)
                         ff_vc1_mc_4mv_luma(v, i, 0, 0);
                     intra_count += s->mb_intra;
@@ -1392,7 +1392,7 @@ static int vc1_decode_p_mb(VC1Context *v)
                 }
                 if (i == 4)
                     ff_vc1_mc_4mv_chroma(v, 0);
-                v->mb_type[0][s->block_index[i]] = is_intra[i];
+                v->mb_type[s->block_index[i]] = is_intra[i];
                 if (!coded_inter)
                     coded_inter = !is_intra[i] & is_coded[i];
             }
@@ -1407,8 +1407,8 @@ static int vc1_decode_p_mb(VC1Context *v)
                 int intrapred = 0;
                 for (i = 0; i < 6; i++)
                     if (is_intra[i]) {
-                        if (((!s->first_slice_line || (i == 2 || i == 3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
-                            || ((s->mb_x || (i == 1 || i == 3)) && v->mb_type[0][s->block_index[i] - 1])) {
+                        if (((!s->first_slice_line || (i == 2 || i == 3)) && v->mb_type[s->block_index[i] - s->block_wrap[i]])
+                            || ((s->mb_x || (i == 1 || i == 3)) && v->mb_type[s->block_index[i] - 1])) {
                             intrapred = 1;
                             break;
                         }
@@ -1428,9 +1428,9 @@ static int vc1_decode_p_mb(VC1Context *v)
                     /* check if prediction blocks A and C are available */
                     v->a_avail = v->c_avail = 0;
                     if (i == 2 || i == 3 || !s->first_slice_line)
-                        v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                        v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
                     if (i == 1 || i == 3 || s->mb_x)
-                        v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                        v->c_avail = v->mb_type[s->block_index[i] - 1];
 
                     ret = vc1_decode_intra_block(v, v->block[v->cur_blk_idx][block_map[i]], i, is_coded[i], mquant,
                                                  (i & 4) ? v->codingset2 : v->codingset);
@@ -1462,11 +1462,11 @@ static int vc1_decode_p_mb(VC1Context *v)
             s->mb_intra                               = 0;
             s->cur_pic.qscale_table[mb_pos] = 0;
             for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
+                v->mb_type[s->block_index[i]] = 0;
                 s->dc_val[s->block_index[i]]  = 0;
             }
             for (i = 0; i < 4; i++) {
-                ff_vc1_pred_mv(v, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0], 0, 0);
+                ff_vc1_pred_mv(v, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type, 0, 0);
                 ff_vc1_mc_4mv_luma(v, i, 0, 0);
             }
             ff_vc1_mc_4mv_chroma(v, 0);
@@ -1569,14 +1569,14 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
             dst_idx = 0;
             for (i = 0; i < 6; i++) {
                 v->a_avail = v->c_avail          = 0;
-                v->mb_type[0][s->block_index[i]] = 1;
+                v->mb_type[s->block_index[i]] = 1;
                 s->dc_val[s->block_index[i]]  = 0;
                 dst_idx += i >> 2;
                 val = ((cbp >> (5 - i)) & 1);
                 if (i == 2 || i == 3 || !s->first_slice_line)
-                    v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                    v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
                 if (i == 1 || i == 3 || s->mb_x)
-                    v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                    v->c_avail = v->mb_type[s->block_index[i] - 1];
 
                 ret = vc1_decode_intra_block(v, v->block[v->cur_blk_idx][block_map[i]], i, val, mquant,
                                              (i & 4) ? v->codingset2 : v->codingset);
@@ -1602,7 +1602,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
             }
             s->mb_intra = v->is_intra[s->mb_x] = 0;
             for (i = 0; i < 6; i++)
-                v->mb_type[0][s->block_index[i]] = 0;
+                v->mb_type[s->block_index[i]] = 0;
             fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][1];
             /* for all motion vector read MVDATA and motion compensate each block */
             dst_idx = 0;
@@ -1672,7 +1672,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
     } else { // skipped
         s->mb_intra = v->is_intra[s->mb_x] = 0;
         for (i = 0; i < 6; i++) {
-            v->mb_type[0][s->block_index[i]] = 0;
+            v->mb_type[s->block_index[i]] = 0;
             s->dc_val[s->block_index[i]] = 0;
         }
         s->cur_pic.mb_type[mb_pos]      = MB_TYPE_SKIP;
@@ -1735,14 +1735,14 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
         dst_idx = 0;
         for (i = 0; i < 6; i++) {
             v->a_avail = v->c_avail          = 0;
-            v->mb_type[0][s->block_index[i]] = 1;
+            v->mb_type[s->block_index[i]] = 1;
             s->dc_val[s->block_index[i]]  = 0;
             dst_idx += i >> 2;
             val = ((cbp >> (5 - i)) & 1);
             if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
             if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                v->c_avail = v->mb_type[s->block_index[i] - 1];
 
             ret = vc1_decode_intra_block(v, v->block[v->cur_blk_idx][block_map[i]], i, val, mquant,
                                          (i & 4) ? v->codingset2 : v->codingset);
@@ -1757,13 +1757,13 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
         s->mb_intra = v->is_intra[s->mb_x] = 0;
         s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16;
         for (i = 0; i < 6; i++)
-            v->mb_type[0][s->block_index[i]] = 0;
+            v->mb_type[s->block_index[i]] = 0;
         if (idx_mbmode <= 5) { // 1-MV
             dmv_x = dmv_y = pred_flag = 0;
             if (idx_mbmode & 1) {
                 get_mvdata_interlaced(v, &dmv_x, &dmv_y, &pred_flag);
             }
-            ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0], pred_flag, 0);
+            ff_vc1_pred_mv(v, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type, pred_flag, 0);
             ff_vc1_mc_1mv(v, 0);
             mb_has_coeffs = !(idx_mbmode & 2);
         } else { // 4-MV
@@ -1772,7 +1772,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
                 dmv_x = dmv_y = pred_flag = 0;
                 if (v->fourmvbp & (8 >> i))
                     get_mvdata_interlaced(v, &dmv_x, &dmv_y, &pred_flag);
-                ff_vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0], pred_flag, 0);
+                ff_vc1_pred_mv(v, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type, pred_flag, 0);
                 ff_vc1_mc_4mv_luma(v, i, 0, 0);
             }
             ff_vc1_mc_4mv_chroma(v, 0);
@@ -1853,7 +1853,7 @@ static int vc1_decode_b_mb(VC1Context *v)
 
     dmv_x[0] = dmv_x[1] = dmv_y[0] = dmv_y[1] = 0;
     for (i = 0; i < 6; i++) {
-        v->mb_type[0][s->block_index[i]] = 0;
+        v->mb_type[s->block_index[i]] = 0;
         s->dc_val[s->block_index[i]]  = 0;
     }
     s->cur_pic.qscale_table[mb_pos] = 0;
@@ -1880,7 +1880,7 @@ static int vc1_decode_b_mb(VC1Context *v)
         }
     }
     for (i = 0; i < 6; i++)
-        v->mb_type[0][s->block_index[i]] = s->mb_intra;
+        v->mb_type[s->block_index[i]] = s->mb_intra;
 
     if (skipped) {
         if (direct)
@@ -1941,14 +1941,14 @@ static int vc1_decode_b_mb(VC1Context *v)
         dst_idx += i >> 2;
         val = ((cbp >> (5 - i)) & 1);
         off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
-        v->mb_type[0][s->block_index[i]] = s->mb_intra;
+        v->mb_type[s->block_index[i]] = s->mb_intra;
         if (s->mb_intra) {
             /* check if prediction blocks A and C are available */
             v->a_avail = v->c_avail = 0;
             if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
             if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                v->c_avail = v->mb_type[s->block_index[i] - 1];
 
             ret = vc1_decode_intra_block(v, s->block[i], i, val, mquant,
                                          (i & 4) ? v->codingset2 : v->codingset);
@@ -2022,14 +2022,14 @@ static int vc1_decode_b_mb_intfi(VC1Context *v)
         dst_idx = 0;
         for (i = 0; i < 6; i++) {
             v->a_avail = v->c_avail          = 0;
-            v->mb_type[0][s->block_index[i]] = 1;
+            v->mb_type[s->block_index[i]] = 1;
             s->dc_val[s->block_index[i]]  = 0;
             dst_idx += i >> 2;
             val = ((cbp >> (5 - i)) & 1);
             if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
             if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                v->c_avail = v->mb_type[s->block_index[i] - 1];
 
             ret = vc1_decode_intra_block(v, s->block[i], i, val, mquant,
                                          (i & 4) ? v->codingset2 : v->codingset);
@@ -2051,7 +2051,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v)
         s->mb_intra = v->is_intra[s->mb_x] = 0;
         s->cur_pic.mb_type[mb_pos + v->mb_off] = MB_TYPE_16x16;
         for (i = 0; i < 6; i++)
-            v->mb_type[0][s->block_index[i]] = 0;
+            v->mb_type[s->block_index[i]] = 0;
         if (v->fmb_is_raw)
             fwd = v->forward_mb_plane[mb_pos] = get_bits1(gb);
         else
@@ -2218,14 +2218,14 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
         dst_idx = 0;
         for (i = 0; i < 6; i++) {
             v->a_avail = v->c_avail          = 0;
-            v->mb_type[0][s->block_index[i]] = 1;
+            v->mb_type[s->block_index[i]] = 1;
             s->dc_val[s->block_index[i]]  = 0;
             dst_idx += i >> 2;
             val = ((cbp >> (5 - i)) & 1);
             if (i == 2 || i == 3 || !s->first_slice_line)
-                v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
+                v->a_avail = v->mb_type[s->block_index[i] - s->block_wrap[i]];
             if (i == 1 || i == 3 || s->mb_x)
-                v->c_avail = v->mb_type[0][s->block_index[i] - 1];
+                v->c_avail = v->mb_type[s->block_index[i] - 1];
 
             ret = vc1_decode_intra_block(v, s->block[i], i, val, mquant,
                                          (i & 4) ? v->codingset2 : v->codingset);
@@ -2315,7 +2315,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
             }
 
             for (i = 0; i < 6; i++)
-                v->mb_type[0][s->block_index[i]] = 0;
+                v->mb_type[s->block_index[i]] = 0;
             fieldtx = v->fieldtx_plane[mb_pos] = ff_vc1_mbmode_intfrp[0][idx_mbmode][1];
             /* for all motion vector read MVDATA and motion compensate each block */
             dst_idx = 0;
@@ -2446,7 +2446,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
         } else { // skipped
             dir = 0;
             for (i = 0; i < 6; i++) {
-                v->mb_type[0][s->block_index[i]] = 0;
+                v->mb_type[s->block_index[i]] = 0;
                 s->dc_val[s->block_index[i]] = 0;
             }
             s->cur_pic.mb_type[mb_pos]      = MB_TYPE_SKIP;
@@ -2562,7 +2562,7 @@ static void vc1_decode_i_blocks(VC1Context *v)
             v->s.ac_pred = get_bits1(&v->s.gb);
 
             for (k = 0; k < 6; k++) {
-                v->mb_type[0][s->block_index[k]] = 1;
+                v->mb_type[s->block_index[k]] = 1;
 
                 val = ((cbp >> (5 - k)) & 1);
 
@@ -2708,7 +2708,7 @@ static int vc1_decode_i_blocks_adv(VC1Context *v)
             s->y_dc_scale = ff_wmv3_dc_scale_table[FFABS(mquant)];
 
             for (k = 0; k < 6; k++) {
-                v->mb_type[0][s->block_index[k]] = 1;
+                v->mb_type[s->block_index[k]] = 1;
 
                 val = ((cbp >> (5 - k)) & 1);
 
diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c
index e788d1890e..1d71d9d5ca 100644
--- a/libavcodec/vc1_loopfilter.c
+++ b/libavcodec/vc1_loopfilter.c
@@ -175,7 +175,7 @@ void ff_vc1_p_overlap_filter(VC1Context *v)
         if (s->mb_x == 0 && (i & 5) != 1)
             continue;
 
-        if (v->mb_type[0][s->block_index[i]] && v->mb_type[0][s->block_index[i] - 1])
+        if (v->mb_type[s->block_index[i]] && v->mb_type[s->block_index[i] - 1])
             vc1_h_overlap_filter(v,
                                  s->mb_x ? left_blk : cur_blk, cur_blk,
                                  v->fcm == ILACE_FRAME && s->mb_x && v->fieldtx_plane[mb_pos - 1],
@@ -188,12 +188,12 @@ void ff_vc1_p_overlap_filter(VC1Context *v)
             if (s->first_slice_line && !(i & 2))
                 continue;
 
-            if (s->mb_x && v->mb_type[0][s->block_index[i] - 2 + (i > 3)] &&
-                v->mb_type[0][s->block_index[i] - s->block_wrap[i] - 2 + (i > 3)])
+            if (s->mb_x && v->mb_type[s->block_index[i] - 2 + (i > 3)] &&
+                v->mb_type[s->block_index[i] - s->block_wrap[i] - 2 + (i > 3)])
                 vc1_v_overlap_filter(v, s->first_slice_line ? left_blk : topleft_blk, left_blk, i);
             if (s->mb_x == s->mb_width - 1)
-                if (v->mb_type[0][s->block_index[i]] &&
-                    v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
+                if (v->mb_type[s->block_index[i]] &&
+                    v->mb_type[s->block_index[i] - s->block_wrap[i]])
                     vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i);
         }
 }
diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
index 9adb71c7ad..db19d95ef9 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -140,10 +140,10 @@ static av_always_inline int get_luma_mv(VC1Context *v, int dir, int16_t *tx, int
 static av_always_inline int get_chroma_mv(VC1Context *v, int dir, int16_t *tx, int16_t *ty)
 {
     MpegEncContext *s = &v->s;
-    int idx = !v->mb_type[0][s->block_index[0]] |
-             (!v->mb_type[0][s->block_index[1]] << 1) |
-             (!v->mb_type[0][s->block_index[2]] << 2) |
-             (!v->mb_type[0][s->block_index[3]] << 3);
+    int idx = !v->mb_type[s->block_index[0]] |
+             (!v->mb_type[s->block_index[1]] << 1) |
+             (!v->mb_type[s->block_index[2]] << 2) |
+             (!v->mb_type[s->block_index[3]] << 3);
     static const uint8_t index2[16] = { 0, 0, 0, 0x01, 0, 0x02, 0x12, 0, 0, 0x03, 0x13, 0, 0x23, 0, 0, 0 };
     int valid_count = popcount4[idx];
 
diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c
index 87d9b6d6dc..202fa8cc3b 100644
--- a/libavcodec/vc1_pred.c
+++ b/libavcodec/vc1_pred.c
@@ -695,7 +695,7 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
     int px, py;
     int sum;
     int r_x, r_y;
-    const uint8_t *is_intra = v->mb_type[0];
+    const uint8_t *is_intra = v->mb_type;
 
     av_assert0(!v->field_mode);
 
@@ -927,19 +927,19 @@ void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y,
         return;
     }
     if (v->bmvtype == BMV_TYPE_INTERPOLATED) {
-        ff_vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type[0], pred_flag[0], 0);
-        ff_vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type[0], pred_flag[1], 1);
+        ff_vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type, pred_flag[0], 0);
+        ff_vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type, pred_flag[1], 1);
         return;
     }
     if (dir) { // backward
-        ff_vc1_pred_mv(v, n, dmv_x[1], dmv_y[1], mv1, v->range_x, v->range_y, v->mb_type[0], pred_flag[1], 1);
+        ff_vc1_pred_mv(v, n, dmv_x[1], dmv_y[1], mv1, v->range_x, v->range_y, v->mb_type, pred_flag[1], 1);
         if (n == 3 || mv1) {
-            ff_vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type[0], 0, 0);
+            ff_vc1_pred_mv(v, 0, dmv_x[0], dmv_y[0],   1, v->range_x, v->range_y, v->mb_type, 0, 0);
         }
     } else { // forward
-        ff_vc1_pred_mv(v, n, dmv_x[0], dmv_y[0], mv1, v->range_x, v->range_y, v->mb_type[0], pred_flag[0], 0);
+        ff_vc1_pred_mv(v, n, dmv_x[0], dmv_y[0], mv1, v->range_x, v->range_y, v->mb_type, pred_flag[0], 0);
         if (n == 3 || mv1) {
-            ff_vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type[0], 0, 1);
+            ff_vc1_pred_mv(v, 0, dmv_x[1], dmv_y[1],   1, v->range_x, v->range_y, v->mb_type, 0, 1);
         }
     }
 }
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 7ee014d4b6..97174d10e3 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -396,9 +396,7 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
     v->mb_type_base = av_mallocz(s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
     if (!v->mb_type_base)
         return AVERROR(ENOMEM);
-    v->mb_type[0]   = v->mb_type_base + s->b8_stride + 1;
-    v->mb_type[1]   = v->mb_type_base + s->b8_stride * (mb_height * 2 + 1) + s->mb_stride + 1;
-    v->mb_type[2]   = v->mb_type[1] + s->mb_stride * (mb_height + 1);
+    v->mb_type = v->mb_type_base + s->b8_stride + 1;
 
     /* allocate memory to store block level MV info */
     v->blk_mv_type_base = av_mallocz(     s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
-- 
ffmpeg-codebot

_______________________________________________
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".

  parent reply	other threads:[~2025-06-15 17:03 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15 16:53 [FFmpeg-devel] [PATCH 00/47] avcodec/mpeg4videodec: Don't zero blocks twice ffmpegagent
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 01/47] " Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 02/47] avcodec/rv10: Perform RV20 initialization during init Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 03/47] avcodec/rv10: Perform RV20 check only for RV20 Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 04/47] avcodec/ituh263dec: Don't process unnecessarily many coefficients Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 05/47] avcodec/ituh263dec: Remove redundant store Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 06/47] avcodec/ituh263enc: Don't use array unnecessarily Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 07/47] avcodec/ituh263enc: Fix indentation Andreas Rheinhardt
2025-06-15 16:53 ` [FFmpeg-devel] [PATCH 08/47] avcodec/mpeg12dec: Don't store block_last_index unnecessarily Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 09/47] avcodec/rv10: Avoid indirection when reading VLC codes Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 10/47] avcodec/mpeg_er: Mark ff_mpeg_er_init() as av_cold Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 11/47] avcodec/mpegvideo_enc: Remove always-true branch Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 12/47] avcodec/motion_est: Fix indentation Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 13/47] avcodec/svq1enc: Don't free scratchbuf upon error Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 14/47] avcodec/svq1enc: Allocate motion_val{8, 16} during init Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 15/47] avcodec/svq1enc: Stop calling ff_mpv_common_init() Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 16/47] avcodec/svq1enc: Remove write-only c_block_{width, height} Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 17/47] avcodec/svq1enc: Set MpegEncContext.avctx only once Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 18/47] avcodec/svq1enc: Don't initialize unneeded block_index Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 19/47] configure: Factor mpegvideoencdsp out of mpegvideoenc Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 20/47] configure: Relax svq1enc->mpegvideoenc dependency Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 21/47] configure: Relax diracdec->mpegvideoenc dependency Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 22/47] configure: Relax snowenc->mpegvideoenc dependency Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 23/47] avcodec/mpegvideo: Don't reset thread_context ptrs unnecessarily Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 24/47] avcodec/mpegvideo: Don't zero unnecessarily Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 25/47] avcodec/mpegvideo: Defer init of enc slice ctxs in ff_mpv_common_init() Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 26/47] avcodec/mpegvideo_enc: Simplify allocating non-slice buffers Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 27/47] avcodec/ituh263dec: Simplify AIC handling Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 28/47] avcodec/ituh263enc: " Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 29/47] avcodec/flvenc: Combine writing bits Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 30/47] avcodec/flvenc: Move ff_flv2_encode_ac_esc() to ituh263enc.c Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 31/47] avcodec/mpegvideo: Redo resetting intra table entry Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 32/47] avcodec/mpegvideo: Avoid {a, d}c_val[{1, 2}] Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 33/47] avcodec/mpegvideo: Provide alignment hint to compiler Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 34/47] avcodec/mpegvideo: Don't reset AC values of upper-left luma block Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 35/47] avcodec/mpegvideo: Combine stores Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 36/47] avcodec/mpeg4video: Don't use ac_val[1], ac_val[2] when cleaning buffers Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 37/47] avcodec/mpegvideo: Only use a single ac_val pointer Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 38/47] avcodec/mpegvideo: Allocate ac_val jointly Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 39/47] avcodec/mpegvideo: Zero-init mbintra_table Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 40/47] avcodec/mpegvideo: Only keep MpegEncContext.dc_val[0] Andreas Rheinhardt
2025-06-15 16:54 ` Andreas Rheinhardt [this message]
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 42/47] avcodec/mpegvideo: Allocate dc_val for each encoder slice Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 43/47] avcodec/{ituh263, mpeg4video}enc: Simplify out-of-slice DC prediction Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 44/47] avcodec/mpeg4video: Move ff_mpeg4_pred_dc() to decoder Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 45/47] avcodec/ituh263enc: Simplify encoding umotion vectors Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 46/47] avcodec/mpegvideo: Reduce stack usage when copying MpegEncContext Andreas Rheinhardt
2025-06-15 16:54 ` [FFmpeg-devel] [PATCH 47/47] avcodec/mpeg4videoenc: Fix data race when using AC prediction Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2123ccc08065efc9cb2d70f3d2e65d833295a479.1750006480.git.ffmpegagent@gmail.com \
    --to=ffmpegagent-at-gmail.com@ffmpeg.org \
    --cc=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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