You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/mpegvideo_enc: Set gob_index once during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -842,6 +842,9 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m)
|
|||||||
if (s->c.modified_quant)
|
if (s->c.modified_quant)
|
||||||
s->c.chroma_qscale_table = ff_h263_chroma_qscale_table;
|
s->c.chroma_qscale_table = ff_h263_chroma_qscale_table;
|
||||||
|
|
||||||
|
// Only used for H.263 and H.263+
|
||||||
|
s->c.gob_index = H263_GOB_HEIGHT(s->c.height);
|
||||||
|
|
||||||
// use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
|
// use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
|
||||||
switch(s->c.codec_id){
|
switch(s->c.codec_id){
|
||||||
case AV_CODEC_ID_H263P:
|
case AV_CODEC_ID_H263P:
|
||||||
|
@@ -3007,25 +3007,17 @@ static int encode_thread(AVCodecContext *c, void *arg){
|
|||||||
s->c.last_dc[0] = 128 * 8 / 13;
|
s->c.last_dc[0] = 128 * 8 / 13;
|
||||||
s->c.last_dc[1] = 128 * 8 / 14;
|
s->c.last_dc[1] = 128 * 8 / 14;
|
||||||
s->c.last_dc[2] = 128 * 8 / 14;
|
s->c.last_dc[2] = 128 * 8 / 14;
|
||||||
|
#if CONFIG_MPEG4_ENCODER
|
||||||
|
} else if (s->c.partitioned_frame) {
|
||||||
|
av_assert1(s->c.codec_id == AV_CODEC_ID_MPEG4);
|
||||||
|
ff_mpeg4_init_partitions(s);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
s->c.mb_skip_run = 0;
|
s->c.mb_skip_run = 0;
|
||||||
memset(s->c.last_mv, 0, sizeof(s->c.last_mv));
|
memset(s->c.last_mv, 0, sizeof(s->c.last_mv));
|
||||||
|
|
||||||
s->last_mv_dir = 0;
|
s->last_mv_dir = 0;
|
||||||
|
|
||||||
switch (s->c.codec_id) {
|
|
||||||
case AV_CODEC_ID_H263:
|
|
||||||
case AV_CODEC_ID_H263P:
|
|
||||||
case AV_CODEC_ID_FLV1:
|
|
||||||
if (CONFIG_H263_ENCODER)
|
|
||||||
s->c.gob_index = H263_GOB_HEIGHT(s->c.height);
|
|
||||||
break;
|
|
||||||
case AV_CODEC_ID_MPEG4:
|
|
||||||
if (CONFIG_MPEG4_ENCODER && s->c.partitioned_frame)
|
|
||||||
ff_mpeg4_init_partitions(s);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
s->c.resync_mb_x = 0;
|
s->c.resync_mb_x = 0;
|
||||||
s->c.resync_mb_y = 0;
|
s->c.resync_mb_y = 0;
|
||||||
s->c.first_slice_line = 1;
|
s->c.first_slice_line = 1;
|
||||||
|
Reference in New Issue
Block a user