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
842 if (s->c.modified_quant)842 if (s->c.modified_quant)
843 s->c.chroma_qscale_table = ff_h263_chroma_qscale_table;843 s->c.chroma_qscale_table = ff_h263_chroma_qscale_table;
844 844
845 // Only used for H.263 and H.263+
846 s->c.gob_index = H263_GOB_HEIGHT(s->c.height);
847
845 // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME848 // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
846 switch(s->c.codec_id){849 switch(s->c.codec_id){
847 case AV_CODEC_ID_H263P:850 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
3007 s->c.last_dc[0] = 128 * 8 / 13;3007 s->c.last_dc[0] = 128 * 8 / 13;
3008 s->c.last_dc[1] = 128 * 8 / 14;3008 s->c.last_dc[1] = 128 * 8 / 14;
3009 s->c.last_dc[2] = 128 * 8 / 14;3009 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
3010 }3015 }
3011 s->c.mb_skip_run = 0;3016 s->c.mb_skip_run = 0;
3012 memset(s->c.last_mv, 0, sizeof(s->c.last_mv));3017 memset(s->c.last_mv, 0, sizeof(s->c.last_mv));
3013 3018
3014 s->last_mv_dir = 0;3019 s->last_mv_dir = 0;
3015 3020
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
3029 s->c.resync_mb_x = 0;3021 s->c.resync_mb_x = 0;
3030 s->c.resync_mb_y = 0;3022 s->c.resync_mb_y = 0;
3031 s->c.first_slice_line = 1;3023 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