summaryrefslogtreecommitdiff
path: root/libavcodec/ratecontrol.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-03-31 17:46:29 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-04-09 02:12:19 +0200
commitf6774f905fb3cfdc319523ac640be30b14c1bc55 (patch)
tree6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/ratecontrol.c
parent60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (diff)
mpegvideo: operate with pointers to AVFrames instead of whole structs
The most interesting parts are initialization in ff_MPV_common_init() and uninitialization in ff_MPV_common_end(). ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL checks for Picture.f, because these functions can be called on uninitialized or partially initialized Pictures. NULL pointer checks are added to ff_thread_release_buffer() stub function. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/ratecontrol.c')
-rw-r--r--libavcodec/ratecontrol.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index f3f19ddd60..dc7f087dbd 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -48,10 +48,10 @@ void ff_write_pass1_stats(MpegEncContext *s)
snprintf(s->avctx->stats_out, 256,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
"fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",
- s->current_picture_ptr->f.display_picture_number,
- s->current_picture_ptr->f.coded_picture_number,
+ s->current_picture_ptr->f->display_picture_number,
+ s->current_picture_ptr->f->coded_picture_number,
s->pict_type,
- s->current_picture.f.quality,
+ s->current_picture.f->quality,
s->i_tex_bits,
s->p_tex_bits,
s->mv_bits,
@@ -777,10 +777,10 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
else
dts_pic = s->last_picture_ptr;
- if (!dts_pic || dts_pic->f.pts == AV_NOPTS_VALUE)
+ if (!dts_pic || dts_pic->f->pts == AV_NOPTS_VALUE)
wanted_bits = (uint64_t)(s->bit_rate * (double)picture_number / fps);
else
- wanted_bits = (uint64_t)(s->bit_rate * (double)dts_pic->f.pts / fps);
+ wanted_bits = (uint64_t)(s->bit_rate * (double)dts_pic->f->pts / fps);
}
diff = s->total_bits - wanted_bits;