Browse code

this should make the decoder safe for big-endian platforms

Originally committed as revision 2560 to svn://svn.ffmpeg.org/ffmpeg/trunk

Mike Melanson authored on 2003/12/04 23:14:43
Showing 1 changed files
... ...
@@ -164,7 +164,11 @@ static void select_delta_tables(TrueMotion1Context *s, int delta_table_index)
164 164
     }
165 165
 }
166 166
 
167
+#ifdef WORDS_BIGENDIAN
168
+static int make_ydt_entry(int p2, int p1, int16_t *ydt)
169
+#else
167 170
 static int make_ydt_entry(int p1, int p2, int16_t *ydt)
171
+#endif
168 172
 {
169 173
     int lo, hi;
170 174
     
... ...
@@ -175,7 +179,11 @@ static int make_ydt_entry(int p1, int p2, int16_t *ydt)
175 175
     return ((lo + (hi << 16)) << 1);
176 176
 }
177 177
 
178
+#ifdef WORDS_BIGENDIAN
179
+static int make_cdt_entry(int p2, int p1, int16_t *cdt)
180
+#else
178 181
 static int make_cdt_entry(int p1, int p2, int16_t *cdt)
182
+#endif
179 183
 {
180 184
     int r, b, lo;
181 185
     
... ...
@@ -438,8 +446,7 @@ static void truemotion1_decode_16bit(TrueMotion1Context *s)
438 438
                 case 0:
439 439
                     /* if macroblock width is 2, apply C-Y-C-Y; else 
440 440
                      * apply C-Y-Y */
441
-                    if ((s->block_type == BLOCK_2x2) ||
442
-                        (s->block_type == BLOCK_2x4)) {
441
+                    if (s->block_width == 2) {
443 442
                         APPLY_C_PREDICTOR();
444 443
                         APPLY_Y_PREDICTOR();
445 444
                         OUTPUT_PIXEL_PAIR();