History

avcodec/mpegvideo_enc: Set gob_index once during init

Andreas Rheinhardt committed 1 year ago

Commit 99187411 parent 7ae20272 files · +8 −13Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/ituh263enc.c +3 −0
  2. libavcodec/mpegvideo_enc.c +5 −13
libavcodec/ituh263enc.c+3−0
@@ -842,6 +842,9 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m) · 841 unmodified lines
842842 if (s->c.modified_quant)
843843 s->c.chroma_qscale_table = ff_h263_chroma_qscale_table;
844844
845+ // Only used for H.263 and H.263+
846+ s->c.gob_index = H263_GOB_HEIGHT(s->c.height);
847+
845848 // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
846849 switch(s->c.codec_id){
847850 case AV_CODEC_ID_H263P:
libavcodec/mpegvideo_enc.c+5−13
@@ -3007,25 +3007,17 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3006 unmodified lines
30073007 s->c.last_dc[0] = 128 * 8 / 13;
30083008 s->c.last_dc[1] = 128 * 8 / 14;
30093009 s->c.last_dc[2] = 128 * 8 / 14;
3010+#if CONFIG_MPEG4_ENCODER
3011+ } else if (s->c.partitioned_frame) {
3012+ av_assert1(s->c.codec_id == AV_CODEC_ID_MPEG4);
3013+ ff_mpeg4_init_partitions(s);
3014+#endif
30103015 }
30113016 s->c.mb_skip_run = 0;
30123017 memset(s->c.last_mv, 0, sizeof(s->c.last_mv));
30133018
30143019 s->last_mv_dir = 0;
30153020
3016− switch (s->c.codec_id) {
3017− case AV_CODEC_ID_H263:
3018− case AV_CODEC_ID_H263P:
3019− case AV_CODEC_ID_FLV1:
3020− if (CONFIG_H263_ENCODER)
3021− s->c.gob_index = H263_GOB_HEIGHT(s->c.height);
3022− break;
3023− case AV_CODEC_ID_MPEG4:
3024− if (CONFIG_MPEG4_ENCODER && s->c.partitioned_frame)
3025− ff_mpeg4_init_partitions(s);
3026− break;
3027− }
3028−
30293021 s->c.resync_mb_x = 0;
30303022 s->c.resync_mb_y = 0;
30313023 s->c.first_slice_line = 1;

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