diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-04-27 22:09:19 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-05-22 15:34:39 +0100 |
commit | d528045558825f01472e9bee873f60c98d661e53 (patch) | |
tree | f810347121f457b9d5f175e0a0e249a937da2452 /libavcodec/mpegvideo_enc.c | |
parent | 6f54dc43cee6b2f5d183acf98b32a3cf8be4a4fc (diff) | |
download | ffmpeg-streaming-d528045558825f01472e9bee873f60c98d661e53.zip ffmpeg-streaming-d528045558825f01472e9bee873f60c98d661e53.tar.gz |
mpegvideo: Have ff_mpeg_unref_picture use AVCodecContext directly
This skips setting the memory to 0 but allows for reuse on different
contextes. Oracle did not report any unsual activity because of it.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index a46b685..116f494 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -886,7 +886,7 @@ av_cold int ff_mpv_encode_end(AVCodecContext *avctx) av_frame_free(&s->tmp_frames[i]); ff_free_picture_tables(&s->new_picture); - ff_mpeg_unref_picture(s, &s->new_picture); + ff_mpeg_unref_picture(s->avctx, &s->new_picture); av_freep(&s->avctx->stats_out); av_freep(&s->ac_stats); @@ -1370,7 +1370,7 @@ no_output_pic: s->reordered_input_picture[0]->f->pict_type != AV_PICTURE_TYPE_B ? 3 : 0; - ff_mpeg_unref_picture(s, &s->new_picture); + ff_mpeg_unref_picture(s->avctx, &s->new_picture); if ((ret = ff_mpeg_ref_picture(s, &s->new_picture, s->reordered_input_picture[0]))) return ret; @@ -1405,14 +1405,14 @@ no_output_pic: s->new_picture.f->data[i] += INPLACE_OFFSET; } } - ff_mpeg_unref_picture(s, &s->current_picture); + ff_mpeg_unref_picture(s->avctx, &s->current_picture); if ((ret = ff_mpeg_ref_picture(s, &s->current_picture, s->current_picture_ptr)) < 0) return ret; s->picture_number = s->new_picture.f->display_picture_number; } else { - ff_mpeg_unref_picture(s, &s->new_picture); + ff_mpeg_unref_picture(s->avctx, &s->new_picture); } return 0; } @@ -1456,7 +1456,7 @@ static void frame_end(MpegEncContext *s) /* release non-reference frames */ for (i = 0; i < MAX_PICTURE_COUNT; i++) { if (!s->picture[i].reference) - ff_mpeg_unref_picture(s, &s->picture[i]); + ff_mpeg_unref_picture(s->avctx, &s->picture[i]); } } @@ -1493,13 +1493,13 @@ static int frame_start(MpegEncContext *s) if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->f->buf[0]) { - ff_mpeg_unref_picture(s, s->last_picture_ptr); + ff_mpeg_unref_picture(s->avctx, s->last_picture_ptr); } s->current_picture_ptr->f->pict_type = s->pict_type; s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I; - ff_mpeg_unref_picture(s, &s->current_picture); + ff_mpeg_unref_picture(s->avctx, &s->current_picture); if ((ret = ff_mpeg_ref_picture(s, &s->current_picture, s->current_picture_ptr)) < 0) return ret; @@ -1511,14 +1511,14 @@ static int frame_start(MpegEncContext *s) } if (s->last_picture_ptr) { - ff_mpeg_unref_picture(s, &s->last_picture); + ff_mpeg_unref_picture(s->avctx, &s->last_picture); if (s->last_picture_ptr->f->buf[0] && (ret = ff_mpeg_ref_picture(s, &s->last_picture, s->last_picture_ptr)) < 0) return ret; } if (s->next_picture_ptr) { - ff_mpeg_unref_picture(s, &s->next_picture); + ff_mpeg_unref_picture(s->avctx, &s->next_picture); if (s->next_picture_ptr->f->buf[0] && (ret = ff_mpeg_ref_picture(s, &s->next_picture, s->next_picture_ptr)) < 0) |