History

avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_time

Instead of setting these unconditionally (they are always zero for H.261, MPEG-1/2, RV30/40, VC-1), add a variant of ff_mpeg_er_frame_start() that sets them and remove setting them from ff_mpeg_er_frame_start(). Also pass these values via parameters instead of reading them from the MPVContext itself. This will allow to move them from MPVContext.

Andreas Rheinhardt committed 1 year ago

Commit 09847241 parent 3c06d874 files · +12 −5Browse files

Unified · Split

4 files
  1. libavcodec/h263dec.c +2 −1
  2. libavcodec/mpeg_er.c +0 −3
  3. libavcodec/mpeg_er.h +9 −0
  4. libavcodec/rv10.c +1 −1
libavcodec/h263dec.c+2−1
@@ -551,7 +551,8 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 550 unmodified lines
551551 return ret;
552552 }
553553
554− ff_mpeg_er_frame_start(s);
554+ ff_mpv_er_frame_start_ext(s, s->partitioned_frame,
555+ s->pp_time, s->pb_time);
555556
556557 /* the second part of the wmv2 header contains the MB skip bits which
557558 * are stored in current_picture->mb_type which is not available before
libavcodec/mpeg_er.c+0−3
@@ -51,10 +51,7 @@ void ff_mpeg_er_frame_start(MpegEncContext *s) · 50 unmodified lines
5151 set_erpic(&er->next_pic, s->next_pic.ptr);
5252 set_erpic(&er->last_pic, s->last_pic.ptr);
5353
54− er->pp_time = s->pp_time;
55− er->pb_time = s->pb_time;
5654 er->quarter_sample = s->quarter_sample;
57− er->partitioned_frame = s->partitioned_frame;
5855
5956 ff_er_frame_start(er);
6057 }
libavcodec/mpeg_er.h+9−0
@@ -24,4 +24,13 @@ · 23 unmodified lines
2424 int ff_mpeg_er_init(MpegEncContext *s);
2525 void ff_mpeg_er_frame_start(MpegEncContext *s);
2626
27+static inline void ff_mpv_er_frame_start_ext(MPVContext *const s, int partitioned_frame,
28+ uint16_t pp_time, uint16_t pb_time)
29+{
30+ s->er.partitioned_frame = partitioned_frame;
31+ s->er.pp_time = pp_time;
32+ s->er.pb_time = pb_time;
33+ ff_mpeg_er_frame_start(s);
34+}
35+
2736 #endif /* AVCODEC_MPEG_ER_H */
libavcodec/rv10.c+1−1
@@ -451,7 +451,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, · 450 unmodified lines
451451 }
452452 if ((ret = ff_mpv_frame_start(&h->c, avctx)) < 0)
453453 return ret;
454− ff_mpeg_er_frame_start(&h->c);
454+ ff_mpv_er_frame_start_ext(&h->c, 0, h->c.pp_time, h->c.pb_time);
455455 } else {
456456 if (h->c.cur_pic.ptr->f->pict_type != h->c.pict_type) {
457457 av_log(h->c.avctx, AV_LOG_ERROR, "Slice type mismatch\n");

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