~ubuntu-branches/ubuntu/precise/ffmpeg-debian/precise

« back to all changes in this revision

Viewing changes to libavcodec/msmpeg4.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-01-20 09:20:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120092053-izz63p40hc98qfgp
Tags: 3:0.svn20090119-1ubuntu1
* merge from debian. LP: #318501
* new version fixes CVE-2008-3230, LP: #253767

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
63
63
static void init_h263_dc_for_msmpeg4(void);
64
64
static inline void msmpeg4_memsetw(short *tab, int val, int n);
65
 
#ifdef CONFIG_ENCODERS
 
65
#if CONFIG_ENCODERS
66
66
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
67
67
static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra);
68
68
#endif //CONFIG_ENCODERS
79
79
 
80
80
#include "msmpeg4data.h"
81
81
 
82
 
#ifdef CONFIG_ENCODERS //strangely gcc includes this even if it is not references
 
82
#if CONFIG_ENCODERS //strangely gcc includes this even if it is not referenced
83
83
static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
84
84
#endif //CONFIG_ENCODERS
85
85
 
109
109
        s->y_dc_scale_table= wmv1_y_dc_scale_table;
110
110
        s->c_dc_scale_table= wmv1_c_dc_scale_table;
111
111
        break;
112
 
#if defined(CONFIG_WMV3_DECODER)||defined(CONFIG_VC1_DECODER)
 
112
#if CONFIG_WMV3_DECODER || CONFIG_VC1_DECODER
113
113
    case 6:
114
114
        s->y_dc_scale_table= wmv3_dc_scale_table;
115
115
        s->c_dc_scale_table= wmv3_dc_scale_table;
134
134
    }
135
135
}
136
136
 
137
 
#ifdef CONFIG_ENCODERS
 
137
#if CONFIG_ENCODERS
138
138
 
139
139
/* build the table which associate a (x,y) motion vector to a vlc */
140
140
static void init_mv_table(MVTable *tab)
411
411
    return pred;
412
412
}
413
413
 
414
 
#ifdef CONFIG_ENCODERS
 
414
#if CONFIG_ENCODERS
415
415
 
416
416
void ff_msmpeg4_encode_motion(MpegEncContext * s,
417
417
                                  int mx, int my)
653
653
       necessitate to modify mpegvideo.c. The problem comes from the
654
654
       fact they decided to store the quantized DC (which would lead
655
655
       to problems if Q could vary !) */
656
 
#if (defined(ARCH_X86)) && !defined PIC
 
656
#if ARCH_X86 && !defined PIC
657
657
    __asm__ volatile(
658
658
        "movl %3, %%eax         \n\t"
659
659
        "shrl $1, %%eax         \n\t"
673
673
        : "%eax", "%edx"
674
674
    );
675
675
#else
676
 
    /* #elif defined (ARCH_ALPHA) */
 
676
    /* #elif ARCH_ALPHA */
677
677
    /* Divisions are extremely costly on Alpha; optimize the most
678
678
       common case. But they are costly everywhere...
679
679
     */
1142
1142
        s->decode_mb= msmpeg4v34_decode_mb;
1143
1143
        break;
1144
1144
    case 5:
1145
 
        if (ENABLE_WMV2_DECODER)
 
1145
        if (CONFIG_WMV2_DECODER)
1146
1146
            s->decode_mb= ff_wmv2_decode_mb;
1147
1147
    case 6:
1148
1148
        //FIXME + TODO VC1 decode mb
1362
1362
        tab[i] = val;
1363
1363
}
1364
1364
 
1365
 
#ifdef CONFIG_ENCODERS
 
1365
#if CONFIG_ENCODERS
1366
1366
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
1367
1367
{
1368
1368
    int range, bit_size, sign, code, bits;