[FFmpeg-cvslog] avcodec/mpegvideo: Move vbv_delay to Mpeg1Context
Andreas Rheinhardt
git at videolan.org
Fri Mar 7 16:22:23 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Jan 29 06:50:51 2022 +0100| [c709a3d424f3dab4dfd994924112dd7ffa1cacdc] | committer: Andreas Rheinhardt
avcodec/mpegvideo: Move vbv_delay to Mpeg1Context
Only used there and only by the main thread.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c709a3d424f3dab4dfd994924112dd7ffa1cacdc
---
libavcodec/mpeg12dec.c | 5 +++--
libavcodec/mpegvideo.h | 1 -
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 64f39ea995..7284f2cd5a 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -90,6 +90,7 @@ typedef struct Mpeg1Context {
int tmpgexs;
int first_slice;
int extradata_decoded;
+ int vbv_delay;
int64_t timecode_frame_start; /*< GOP timecode frame start number, in non drop frame format */
} Mpeg1Context;
@@ -953,7 +954,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
(s->bit_rate != 0x3FFFF*400)) {
avctx->rc_max_rate = s->bit_rate;
} else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate &&
- (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) {
+ (s->bit_rate != 0x3FFFF*400 || s1->vbv_delay != 0xFFFF)) {
avctx->bit_rate = s->bit_rate;
}
s1->save_aspect = s->avctx->sample_aspect_ratio;
@@ -1024,7 +1025,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
return AVERROR_INVALIDDATA;
vbv_delay = get_bits(&s->gb, 16);
- s->vbv_delay = vbv_delay;
+ s1->vbv_delay = vbv_delay;
if (s->pict_type == AV_PICTURE_TYPE_P ||
s->pict_type == AV_PICTURE_TYPE_B) {
s->full_pel[0] = get_bits1(&s->gb);
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 43d4bbfbcb..10be87450a 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -204,7 +204,6 @@ typedef struct MpegEncContext {
int adaptive_quant; ///< use adaptive quantization
int dquant; ///< qscale difference to prev qscale
int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
- int vbv_delay;
int last_pict_type; //FIXME removes
int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol
int droppable;
More information about the ffmpeg-cvslog
mailing list