[FFmpeg-devel] [PATCH v2 29/71] avcodec/h263: Move setting mbskip_table to decoder/encoders
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Sat May 11 23:50:53 EEST 2024
This removes a branch from H.263 based decoders.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/h263.c | 3 ---
libavcodec/ituh263enc.c | 3 +++
libavcodec/mpeg4videodec.c | 4 ++++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index b4cf5ee0de..9849f651cb 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -56,9 +56,6 @@ void ff_h263_update_motion_val(MpegEncContext * s){
const int wrap = s->b8_stride;
const int xy = s->block_index[0];
- if (s->current_picture.mbskip_table)
- s->current_picture.mbskip_table[mb_xy] = s->mb_skipped;
-
if(s->mv_type != MV_TYPE_8X8){
int motion_x, motion_y;
if (s->mb_intra) {
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index 87689e5f5b..e27bd258d7 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -692,6 +692,9 @@ void ff_h263_update_mb(MpegEncContext *s)
{
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
+ if (s->current_picture.mbskip_table)
+ s->current_picture.mbskip_table[mb_xy] = s->mb_skipped;
+
if (s->mv_type == MV_TYPE_8X8)
s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8;
else if(s->mb_intra)
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 6a7a37e817..482bc48f89 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1592,9 +1592,11 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
&& ctx->vol_sprite_usage == GMC_SPRITE) {
s->mcsel = 1;
s->mb_skipped = 0;
+ s->current_picture.mbskip_table[xy] = 0;
} else {
s->mcsel = 0;
s->mb_skipped = 1;
+ s->current_picture.mbskip_table[xy] = 1;
}
} else if (s->mb_intra) {
s->ac_pred = IS_ACPRED(s->current_picture.mb_type[xy]);
@@ -1676,6 +1678,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
s->mcsel = 1;
s->mv[0][0][0] = get_amv(ctx, 0);
s->mv[0][0][1] = get_amv(ctx, 1);
+ s->current_picture.mbskip_table[xy] = 0;
s->mb_skipped = 0;
} else {
s->current_picture.mb_type[xy] = MB_TYPE_SKIP |
@@ -1684,6 +1687,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
s->mcsel = 0;
s->mv[0][0][0] = 0;
s->mv[0][0][1] = 0;
+ s->current_picture.mbskip_table[xy] = 1;
s->mb_skipped = 1;
}
goto end;
--
2.40.1
More information about the ffmpeg-devel
mailing list