History

mpegvideo: Have ff_mpeg_ref_picture use AVCodecContext directly

Vittorio Giovara committed 11 years ago

Commit a3f4c931 parent d5280453 files · +13 −13Browse files

Unified · Split

3 files
  1. libavcodec/mpegvideo.c +7 −7
  2. libavcodec/mpegvideo.h +1 −1
  3. libavcodec/mpegvideo_enc.c +5 −5
libavcodec/mpegvideo.c+7−7
@@ -727,7 +727,7 @@ do {\ · 726 unmodified lines
727727 return 0;
728728 }
729729
730−int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)
730+int ff_mpeg_ref_picture(AVCodecContext *avctx, Picture *dst, Picture *src)
731731 {
732732 int ret;
733733
@@ -761,7 +761,7 @@ int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src) · 27 unmodified lines
761761
762762 return 0;
763763 fail:
764− ff_mpeg_unref_picture(s->avctx, dst);
764+ ff_mpeg_unref_picture(avctx, dst);
765765 return ret;
766766 }
767767
@@ -937,7 +937,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, · 169 unmodified lines
937937 for (i = 0; i < MAX_PICTURE_COUNT; i++) {
938938 ff_mpeg_unref_picture(s->avctx, &s->picture[i]);
939939 if (s1->picture[i].f->buf[0] &&
940− (ret = ff_mpeg_ref_picture(s, &s->picture[i], &s1->picture[i])) < 0)
940+ (ret = ff_mpeg_ref_picture(s->avctx, &s->picture[i], &s1->picture[i])) < 0)
941941 return ret;
942942 }
943943
@@ -945,7 +945,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, · 1 unmodified line
945945 do {\
946946 ff_mpeg_unref_picture(s->avctx, &s->pic);\
947947 if (s1->pic.f->buf[0])\
948− ret = ff_mpeg_ref_picture(s, &s->pic, &s1->pic);\
948+ ret = ff_mpeg_ref_picture(s->avctx, &s->pic, &s1->pic);\
949949 else\
950950 ret = update_picture_tables(&s->pic, &s1->pic);\
951951 if (ret < 0)\
@@ -1741,7 +1741,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 789 unmodified lines
17411741 // s->current_picture_ptr->quality = s->new_picture_ptr->quality;
17421742 s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
17431743
1744− if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
1744+ if ((ret = ff_mpeg_ref_picture(s->avctx, &s->current_picture,
17451745 s->current_picture_ptr)) < 0)
17461746 return ret;
17471747
@@ -1822,14 +1822,14 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 74 unmodified lines
18221822 if (s->last_picture_ptr) {
18231823 ff_mpeg_unref_picture(s->avctx, &s->last_picture);
18241824 if (s->last_picture_ptr->f->buf[0] &&
1825− (ret = ff_mpeg_ref_picture(s, &s->last_picture,
1825+ (ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture,
18261826 s->last_picture_ptr)) < 0)
18271827 return ret;
18281828 }
18291829 if (s->next_picture_ptr) {
18301830 ff_mpeg_unref_picture(s->avctx, &s->next_picture);
18311831 if (s->next_picture_ptr->f->buf[0] &&
1832− (ret = ff_mpeg_ref_picture(s, &s->next_picture,
1832+ (ret = ff_mpeg_ref_picture(s->avctx, &s->next_picture,
18331833 s->next_picture_ptr)) < 0)
18341834 return ret;
18351835 }
libavcodec/mpegvideo.h+1−1
@@ -863,7 +863,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s, · 862 unmodified lines
863863 int16_t block[6][64],
864864 int motion_x, int motion_y);
865865
866−int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src);
866+int ff_mpeg_ref_picture(AVCodecContext *avctx, Picture *dst, Picture *src);
867867 void ff_mpeg_unref_picture(AVCodecContext *avctx, Picture *picture);
868868 void ff_free_picture_tables(Picture *pic);
869869
libavcodec/mpegvideo_enc.c+5−5
@@ -1371,7 +1371,7 @@ no_output_pic: · 1370 unmodified lines
13711371 AV_PICTURE_TYPE_B ? 3 : 0;
13721372
13731373 ff_mpeg_unref_picture(s->avctx, &s->new_picture);
1374− if ((ret = ff_mpeg_ref_picture(s, &s->new_picture, s->reordered_input_picture[0])))
1374+ if ((ret = ff_mpeg_ref_picture(s->avctx, &s->new_picture, s->reordered_input_picture[0])))
13751375 return ret;
13761376
13771377 if (s->reordered_input_picture[0]->shared || s->avctx->rc_buffer_size) {
@@ -1406,7 +1406,7 @@ no_output_pic: · 28 unmodified lines
14061406 }
14071407 }
14081408 ff_mpeg_unref_picture(s->avctx, &s->current_picture);
1409− if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
1409+ if ((ret = ff_mpeg_ref_picture(s->avctx, &s->current_picture,
14101410 s->current_picture_ptr)) < 0)
14111411 return ret;
14121412
@@ -1500,7 +1500,7 @@ static int frame_start(MpegEncContext *s) · 87 unmodified lines
15001500 s->current_picture_ptr->f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
15011501
15021502 ff_mpeg_unref_picture(s->avctx, &s->current_picture);
1503− if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
1503+ if ((ret = ff_mpeg_ref_picture(s->avctx, &s->current_picture,
15041504 s->current_picture_ptr)) < 0)
15051505 return ret;
15061506
@@ -1513,14 +1513,14 @@ static int frame_start(MpegEncContext *s) · 6 unmodified lines
15131513 if (s->last_picture_ptr) {
15141514 ff_mpeg_unref_picture(s->avctx, &s->last_picture);
15151515 if (s->last_picture_ptr->f->buf[0] &&
1516− (ret = ff_mpeg_ref_picture(s, &s->last_picture,
1516+ (ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture,
15171517 s->last_picture_ptr)) < 0)
15181518 return ret;
15191519 }
15201520 if (s->next_picture_ptr) {
15211521 ff_mpeg_unref_picture(s->avctx, &s->next_picture);
15221522 if (s->next_picture_ptr->f->buf[0] &&
1523− (ret = ff_mpeg_ref_picture(s, &s->next_picture,
1523+ (ret = ff_mpeg_ref_picture(s->avctx, &s->next_picture,
15241524 s->next_picture_ptr)) < 0)
15251525 return ret;
15261526 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t