1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/vc1: Add max_b_frames field to VC1Context

Don't reuse MpegEncContext.max_b_frames, which is supposed
to be encoder-only.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-02-24 19:05:32 +01:00
parent 9202179754
commit 1adc84136e
6 changed files with 7 additions and 6 deletions

View File

@ -117,7 +117,7 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx,
(v->multires << 5) |
(v->resync_marker << 4) |
(v->rangered << 3) |
(s->max_b_frames );
(v->max_b_frames );
pp->bPicExtrapolation = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->overlap) << 6) |
((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |

View File

@ -844,7 +844,7 @@ static av_cold int wmv9_init(AVCodecContext *avctx)
v->resync_marker = 0;
v->rangered = 0;
v->s.max_b_frames = avctx->max_b_frames = 0;
v->max_b_frames = avctx->max_b_frames = 0;
v->quantizer_mode = 0;
v->finterpflag = 0;

View File

@ -84,7 +84,7 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u
.multires = v->multires,
.syncmarker = v->resync_marker,
.rangered = v->rangered,
.maxbframes = s->max_b_frames,
.maxbframes = v->max_b_frames,
.panscan_flag = v->panscanflag,
.refdist_flag = v->refdist_flag,

View File

@ -343,7 +343,7 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
"RANGERED should be set to 0 in Simple Profile\n");
}
v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
v->max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
v->quantizer_mode = get_bits(gb, 2); //common
v->finterpflag = get_bits1(gb); //common
@ -431,7 +431,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
av_log(v->s.avctx, AV_LOG_ERROR, "Progressive Segmented Frame mode: not supported (yet)\n");
return -1;
}
v->s.max_b_frames = v->s.avctx->max_b_frames = 7;
v->max_b_frames = v->s.avctx->max_b_frames = 7;
if (get_bits1(gb)) { //Display Info - decoding is not affected by it
int w, h, ar = 0;
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");

View File

@ -222,6 +222,7 @@ typedef struct VC1Context{
int dquant; ///< How qscale varies with MBs, 2 bits (not in Simple)
int vstransform; ///< variable-size [48]x[48] transform type + info
int overlap; ///< overlapped transforms in use
int max_b_frames; ///< max number of B-frames
int quantizer_mode; ///< 2 bits, quantizer mode used for sequence, see QUANT_*
int finterpflag; ///< INTERPFRM present
//@}

View File

@ -92,7 +92,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
info->multires = v->multires;
info->syncmarker = v->resync_marker;
info->rangered = v->rangered | (v->rangeredfrm << 1);
info->maxbframes = v->s.max_b_frames;
info->maxbframes = v->max_b_frames;
info->deblockEnable = v->postprocflag & 1;
info->pquant = v->pq;