Go to the documentation of this file.
31 #include "config_components.h"
62 int uni_code, uni_len;
80 uni_code ^= (1 << uni_len) - 1;
83 uni_code <<=
size; uni_code |= l;
86 uni_code <<= 1; uni_code |= 1;
96 uni_code ^= (1 << uni_len) - 1;
99 uni_code <<=
size; uni_code |= l;
102 uni_code <<= 1; uni_code |= 1;
122 uint8_t permutated_intra_h_scantable[64],
123 uint8_t permutated_intra_v_scantable[64])
127 switch(
s->msmpeg4_version){
129 av_unreachable(
"ff_msmpeg4_common_init only called by MSMP4 1-3 and WMV1/2");
135 if(
s->workaround_bugs){
143 #if CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER
154 s->idsp.idct_permutation);
156 s->idsp.idct_permutation);
168 xy =
s->block_index[n];
174 a =
s->coded_block[xy - 1 ];
175 b =
s->coded_block[xy - 1 -
wrap];
176 c =
s->coded_block[xy -
wrap];
185 *coded_block_ptr = &
s->coded_block[xy];
194 for(y=0; y<block_size; y++){
196 for(x=0; x<block_size; x++){
205 int16_t **dc_val_ptr,
int *dir_ptr)
208 int16_t *
const dc_val =
s->dc_val +
s->block_index[n];
217 wrap =
s->block_wrap[n];
223 b = dc_val[ - 1 -
wrap];
226 if (
s->first_slice_line && !(n & 2) &&
s->msmpeg4_version < MSMP4_WMV1)
233 #if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE
235 "movl %3, %%eax \n\t"
236 "shrl $1, %%eax \n\t"
237 "addl %%eax, %2 \n\t"
238 "addl %%eax, %1 \n\t"
239 "addl %0, %%eax \n\t"
241 "movl %%edx, %0 \n\t"
242 "movl %1, %%eax \n\t"
244 "movl %%edx, %1 \n\t"
245 "movl %2, %%eax \n\t"
247 "movl %%edx, %2 \n\t"
248 :
"+b" (
a),
"+c" (
b),
"+D" (
c)
255 a = (
a + (8 >> 1)) / 8;
256 b = (
b + (8 >> 1)) / 8;
257 c = (
c + (8 >> 1)) / 8;
266 if (
s->msmpeg4_version > MSMP4_V3) {
267 if(
s->inter_intra_pred){
286 int bs = 8 >>
s->avctx->lowres;
289 dest =
s->cur_pic.data[0] + (((n >> 1) + 2*
s->mb_y) * bs*
wrap ) + ((n & 1) + 2*
s->mb_x) * bs;
292 dest =
s->cur_pic.data[n - 3] + (
s->mb_y * bs *
wrap) +
s->mb_x * bs;
299 if (
s->h263_aic_dir==0) {
302 }
else if (
s->h263_aic_dir==1) {
310 }
else if (
s->h263_aic_dir==2) {
343 *dc_val_ptr = &dc_val[0];
RLTable ff_rl_table[NB_RL_TABLES]
const uint32_t ff_inverse[257]
av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], const uint8_t permutation[64])
const uint8_t ff_mpeg4_DCtab_chrom[13][2]
void ff_init_scantable(const uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
static int ff_thread_once(char *control, void(*routine)(void))
av_cold void ff_rl_init(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
Initialize index_run, max_level and max_run from n, last, table_vlc, table_run and table_level.
const uint8_t ff_mpeg4_DCtab_lum[13][2]
#define av_unreachable(msg)
Asserts that are used as compiler optimization hints depending upon ASSERT_LEVEL and NBDEBUG.
uint32_t ff_v2_dc_lum_table[512][2]
static int get_dc(uint8_t *src, int stride, int scale, int block_size)
uint32_t ff_v2_dc_chroma_table[512][2]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
av_cold void ff_wmv2dsp_init(IDCTDSPContext *c)
const uint8_t ff_mpeg4_y_dc_scale_table[32]
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, int16_t **dc_val_ptr, int *dir_ptr)
#define i(width, name, range_min, range_max)
av_cold void ff_msmpeg4_common_init(MPVContext *const s, uint8_t permutated_intra_h_scantable[64], uint8_t permutated_intra_v_scantable[64])
static av_cold void msmpeg4_common_init_static(void)
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
static const float pred[4]
const uint8_t ff_old_ff_y_dc_scale_table[32]
const uint8_t ff_mpeg4_c_dc_scale_table[32]
const uint8_t ff_wmv1_y_dc_scale_table[32]
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static av_cold void init_h263_dc_for_msmpeg4(void)
const uint8_t ff_wmv1_c_dc_scale_table[32]
const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)