You've already forked FFmpeg
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:
@ -117,7 +117,7 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx,
|
|||||||
(v->multires << 5) |
|
(v->multires << 5) |
|
||||||
(v->resync_marker << 4) |
|
(v->resync_marker << 4) |
|
||||||
(v->rangered << 3) |
|
(v->rangered << 3) |
|
||||||
(s->max_b_frames );
|
(v->max_b_frames );
|
||||||
pp->bPicExtrapolation = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
|
pp->bPicExtrapolation = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
|
||||||
pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->overlap) << 6) |
|
pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->overlap) << 6) |
|
||||||
((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
|
((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
|
||||||
|
@ -844,7 +844,7 @@ static av_cold int wmv9_init(AVCodecContext *avctx)
|
|||||||
v->resync_marker = 0;
|
v->resync_marker = 0;
|
||||||
v->rangered = 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->quantizer_mode = 0;
|
||||||
|
|
||||||
v->finterpflag = 0;
|
v->finterpflag = 0;
|
||||||
|
@ -84,7 +84,7 @@ static int nvdec_vc1_start_frame(AVCodecContext *avctx, const uint8_t *buffer, u
|
|||||||
.multires = v->multires,
|
.multires = v->multires,
|
||||||
.syncmarker = v->resync_marker,
|
.syncmarker = v->resync_marker,
|
||||||
.rangered = v->rangered,
|
.rangered = v->rangered,
|
||||||
.maxbframes = s->max_b_frames,
|
.maxbframes = v->max_b_frames,
|
||||||
|
|
||||||
.panscan_flag = v->panscanflag,
|
.panscan_flag = v->panscanflag,
|
||||||
.refdist_flag = v->refdist_flag,
|
.refdist_flag = v->refdist_flag,
|
||||||
|
@ -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");
|
"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->quantizer_mode = get_bits(gb, 2); //common
|
||||||
|
|
||||||
v->finterpflag = get_bits1(gb); //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");
|
av_log(v->s.avctx, AV_LOG_ERROR, "Progressive Segmented Frame mode: not supported (yet)\n");
|
||||||
return -1;
|
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
|
if (get_bits1(gb)) { //Display Info - decoding is not affected by it
|
||||||
int w, h, ar = 0;
|
int w, h, ar = 0;
|
||||||
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
|
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
|
||||||
|
@ -222,6 +222,7 @@ typedef struct VC1Context{
|
|||||||
int dquant; ///< How qscale varies with MBs, 2 bits (not in Simple)
|
int dquant; ///< How qscale varies with MBs, 2 bits (not in Simple)
|
||||||
int vstransform; ///< variable-size [48]x[48] transform type + info
|
int vstransform; ///< variable-size [48]x[48] transform type + info
|
||||||
int overlap; ///< overlapped transforms in use
|
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 quantizer_mode; ///< 2 bits, quantizer mode used for sequence, see QUANT_*
|
||||||
int finterpflag; ///< INTERPFRM present
|
int finterpflag; ///< INTERPFRM present
|
||||||
//@}
|
//@}
|
||||||
|
@ -92,7 +92,7 @@ static int vdpau_vc1_start_frame(AVCodecContext *avctx,
|
|||||||
info->multires = v->multires;
|
info->multires = v->multires;
|
||||||
info->syncmarker = v->resync_marker;
|
info->syncmarker = v->resync_marker;
|
||||||
info->rangered = v->rangered | (v->rangeredfrm << 1);
|
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->deblockEnable = v->postprocflag & 1;
|
||||||
info->pquant = v->pq;
|
info->pquant = v->pq;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user