diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-03 00:07:04 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-20 18:58:38 +0200 |
commit | f5d5b80f3c58eec38d97ffcc8a4d24cd2eba2de0 (patch) | |
tree | 2faff38c5ee806083412cfda844eccb7a271915f /libavcodec/rv34.c | |
parent | 07ae09bdf18b117e809224fbddcca6eaf7273c4b (diff) | |
download | ffmpeg-f5d5b80f3c58eec38d97ffcc8a4d24cd2eba2de0.tar.gz |
avcodec/mpegutils: Don't use MB_TYPE_L[01] for mpegvideo
MB_TYPE_L[01] is based upon H.264 terminology (it stands for
list); yet the mpegvideo based decoders don't have lists
of reference frames, they have at most one forward and one
backward reference. So use terminology based upon this.
This also has a second advantage: MB_TYPE_L[01] is actually
an OR of two flags (which are set independently for H.264,
but aren't for mpegvideo). Switching to different flags
makes the flags fit into an int16_t, which will be useful
in future commits.
The only downside to this is a very small amount of code
in error_resilience.c and mpegutils.c (the only code shared
between the H.264 decoder and mpegvideo).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r-- | libavcodec/rv34.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 728e117df4..d94285431e 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -59,16 +59,16 @@ static inline void ZERO8x2(void* dst, int stride) static const int rv34_mb_type_to_lavc[12] = { MB_TYPE_INTRA, MB_TYPE_INTRA16x16 | MB_TYPE_SEPARATE_DC, - MB_TYPE_16x16 | MB_TYPE_L0, - MB_TYPE_8x8 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L1, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_8x8 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_BACKWARD_MV, MB_TYPE_SKIP, MB_TYPE_DIRECT2 | MB_TYPE_16x16, - MB_TYPE_16x8 | MB_TYPE_L0, - MB_TYPE_8x16 | MB_TYPE_L0, - MB_TYPE_16x16 | MB_TYPE_L0L1, - MB_TYPE_16x16 | MB_TYPE_L0 | MB_TYPE_SEPARATE_DC + MB_TYPE_16x8 | MB_TYPE_FORWARD_MV, + MB_TYPE_8x16 | MB_TYPE_FORWARD_MV, + MB_TYPE_16x16 | MB_TYPE_BIDIR_MV, + MB_TYPE_16x16 | MB_TYPE_FORWARD_MV | MB_TYPE_SEPARATE_DC }; @@ -568,7 +568,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) int mx, my; int i, j; MPVWorkPicture *cur_pic = &s->cur_pic; - const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; + const int mask = dir ? MB_TYPE_BACKWARD_MV : MB_TYPE_FORWARD_MV; int type = cur_pic->mb_type[mb_pos]; if((r->avail_cache[6-1] & type) & mask){ |