| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Duck TrueMotion 1.0 Decoder | 2 * Duck TrueMotion 1.0 Decoder |
| 3 * Copyright (C) 2003 Alex Beregszaszi & Mike Melanson | 3 * Copyright (C) 2003 Alex Beregszaszi & Mike Melanson |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 { | 171 { |
| 172 int lo, hi; | 172 int lo, hi; |
| 173 | 173 |
| 174 lo = ydt[p1]; | 174 lo = ydt[p1]; |
| 175 lo += (lo << 5) + (lo << 10); | 175 lo += (lo << 5) + (lo << 10); |
| 176 hi = ydt[p2]; | 176 hi = ydt[p2]; |
| 177 hi += (hi << 5) + (hi << 10); | 177 hi += (hi << 5) + (hi << 10); |
| 178 return (lo + (hi << 16)) << 1; | 178 return (lo + (hi << 16)) << 1; |
| 179 } | 179 } |
| 180 | 180 |
| 181 #if HAVE_BIGENDIAN | |
| 182 static int make_cdt15_entry(int p2, int p1, int16_t *cdt) | |
| 183 #else | |
| 184 static int make_cdt15_entry(int p1, int p2, int16_t *cdt) | 181 static int make_cdt15_entry(int p1, int p2, int16_t *cdt) |
| 185 #endif | |
| 186 { | 182 { |
| 187 int r, b, lo; | 183 int r, b, lo; |
| 188 | 184 |
| 189 b = cdt[p2]; | 185 b = cdt[p2]; |
| 190 r = cdt[p1] << 10; | 186 r = cdt[p1] << 10; |
| 191 lo = b + r; | 187 lo = b + r; |
| 192 return (lo + (lo << 16)) << 1; | 188 return (lo + (lo << 16)) << 1; |
| 193 } | 189 } |
| 194 | 190 |
| 195 #if HAVE_BIGENDIAN | 191 #if HAVE_BIGENDIAN |
| 196 static int make_ydt16_entry(int p2, int p1, int16_t *ydt) | 192 static int make_ydt16_entry(int p2, int p1, int16_t *ydt) |
| 197 #else | 193 #else |
| 198 static int make_ydt16_entry(int p1, int p2, int16_t *ydt) | 194 static int make_ydt16_entry(int p1, int p2, int16_t *ydt) |
| 199 #endif | 195 #endif |
| 200 { | 196 { |
| 201 int lo, hi; | 197 int lo, hi; |
| 202 | 198 |
| 203 lo = ydt[p1]; | 199 lo = ydt[p1]; |
| 204 lo += (lo << 6) + (lo << 11); | 200 lo += (lo << 6) + (lo << 11); |
| 205 hi = ydt[p2]; | 201 hi = ydt[p2]; |
| 206 hi += (hi << 6) + (hi << 11); | 202 hi += (hi << 6) + (hi << 11); |
| 207 return (lo + (hi << 16)) << 1; | 203 return (lo + (hi << 16)) << 1; |
| 208 } | 204 } |
| 209 | 205 |
| 210 #if HAVE_BIGENDIAN | |
| 211 static int make_cdt16_entry(int p2, int p1, int16_t *cdt) | |
| 212 #else | |
| 213 static int make_cdt16_entry(int p1, int p2, int16_t *cdt) | 206 static int make_cdt16_entry(int p1, int p2, int16_t *cdt) |
| 214 #endif | |
| 215 { | 207 { |
| 216 int r, b, lo; | 208 int r, b, lo; |
| 217 | 209 |
| 218 b = cdt[p2]; | 210 b = cdt[p2]; |
| 219 r = cdt[p1] << 11; | 211 r = cdt[p1] << 11; |
| 220 lo = b + r; | 212 lo = b + r; |
| 221 return (lo + (lo << 16)) << 1; | 213 return (lo + (lo << 16)) << 1; |
| 222 } | 214 } |
| 223 | 215 |
| 224 #if HAVE_BIGENDIAN | |
| 225 static int make_ydt24_entry(int p2, int p1, int16_t *ydt) | |
| 226 #else | |
| 227 static int make_ydt24_entry(int p1, int p2, int16_t *ydt) | 216 static int make_ydt24_entry(int p1, int p2, int16_t *ydt) |
| 228 #endif | |
| 229 { | 217 { |
| 230 int lo, hi; | 218 int lo, hi; |
| 231 | 219 |
| 232 lo = ydt[p1]; | 220 lo = ydt[p1]; |
| 233 hi = ydt[p2]; | 221 hi = ydt[p2]; |
| 234 return (lo + (hi << 8) + (hi << 16)) << 1; | 222 return (lo + (hi << 8) + (hi << 16)) << 1; |
| 235 } | 223 } |
| 236 | 224 |
| 237 #if HAVE_BIGENDIAN | |
| 238 static int make_cdt24_entry(int p2, int p1, int16_t *cdt) | |
| 239 #else | |
| 240 static int make_cdt24_entry(int p1, int p2, int16_t *cdt) | 225 static int make_cdt24_entry(int p1, int p2, int16_t *cdt) |
| 241 #endif | |
| 242 { | 226 { |
| 243 int r, b; | 227 int r, b; |
| 244 | 228 |
| 245 b = cdt[p2]; | 229 b = cdt[p2]; |
| 246 r = cdt[p1]<<16; | 230 r = cdt[p1]<<16; |
| 247 return (b+r) << 1; | 231 return (b+r) << 1; |
| 248 } | 232 } |
| 249 | 233 |
| 250 static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_
table) | 234 static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_
table) |
| 251 { | 235 { |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 AVMEDIA_TYPE_VIDEO, | 879 AVMEDIA_TYPE_VIDEO, |
| 896 CODEC_ID_TRUEMOTION1, | 880 CODEC_ID_TRUEMOTION1, |
| 897 sizeof(TrueMotion1Context), | 881 sizeof(TrueMotion1Context), |
| 898 truemotion1_decode_init, | 882 truemotion1_decode_init, |
| 899 NULL, | 883 NULL, |
| 900 truemotion1_decode_end, | 884 truemotion1_decode_end, |
| 901 truemotion1_decode_frame, | 885 truemotion1_decode_frame, |
| 902 CODEC_CAP_DR1, | 886 CODEC_CAP_DR1, |
| 903 .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"), | 887 .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"), |
| 904 }; | 888 }; |
| OLD | NEW |