History

avcodec/ituh263enc: Move MPEG-4 fcode_tab to mpeg4videoenc.c

Andreas Rheinhardt committed 1 year ago

Commit 94f36421 parent 3977abc2 files · +11 −12Browse files

Unified · Split

2 files
  1. libavcodec/ituh263enc.c +0 −12
  2. libavcodec/mpeg4videoenc.c +11 −0
libavcodec/ituh263enc.c+0−12
@@ -52,11 +52,6 @@ · 51 unmodified lines
5252 */
5353 static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV*2+1];
5454
55−/**
56− * Minimal fcode that a motion vector component would need.
57− */
58−static uint8_t fcode_tab[MAX_MV*2+1];
59−
6055 /**
6156 * Minimal fcode that a motion vector component would need in umv.
6257 * All entries in this table are 1.
@@ -762,12 +757,6 @@ static av_cold void init_mv_penalty_and_fcode(void) · 699 unmodified lines
762757 }
763758 }
764759
765− for(f_code=MAX_FCODE; f_code>0; f_code--){
766− for(mv=-(16<<f_code); mv<(16<<f_code); mv++){
767− fcode_tab[mv+MAX_MV]= f_code;
768− }
769− }
770−
771760 for(mv=0; mv<MAX_MV*2+1; mv++){
772761 umv_fcode_tab[mv]= 1;
773762 }
@@ -844,7 +833,6 @@ av_cold void ff_h263_encode_init(MpegEncContext *s) · 70 unmodified lines
844833 // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME
845834 switch(s->codec_id){
846835 case AV_CODEC_ID_MPEG4:
847− s->fcode_tab= fcode_tab;
848836 break;
849837 case AV_CODEC_ID_H263P:
850838 if(s->umvplus)
libavcodec/mpeg4videoenc.c+11−0
@@ -37,6 +37,11 @@ · 36 unmodified lines
3737 #include "profiles.h"
3838 #include "version.h"
3939
40+/**
41+ * Minimal fcode that a motion vector component would need.
42+ */
43+static uint8_t fcode_tab[MAX_MV*2+1];
44+
4045 /* The uni_DCtab_* tables below contain unified bits+length tables to encode DC
4146 * differences in MPEG-4. Unified in the sense that the specification specifies
4247 * this encoding in several steps. */
@@ -1255,6 +1260,11 @@ static av_cold void mpeg4_encode_init_static(void) · 1212 unmodified lines
12551260
12561261 init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
12571262 init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
1263+
1264+ for (int f_code = MAX_FCODE; f_code > 0; f_code--) {
1265+ for (int mv = -(16 << f_code); mv < (16 << f_code); mv++)
1266+ fcode_tab[mv + MAX_MV] = f_code;
1267+ }
12581268 }
12591269
12601270 static av_cold int encode_init(AVCodecContext *avctx)
@@ -1274,6 +1284,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 13 unmodified lines
12741284
12751285 ff_thread_once(&init_static_once, mpeg4_encode_init_static);
12761286
1287+ s->fcode_tab = fcode_tab;
12771288 s->min_qcoeff = -2048;
12781289 s->max_qcoeff = 2047;
12791290 s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len;

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