Mercurial > libavcodec.hg
comparison ulti.c @ 5089:bff60ecc02f9 libavcodec
Use AV_xx throughout libavcodec
author | ramiro |
---|---|
date | Sat, 02 Jun 2007 01:41:07 +0000 |
parents | f99e40a7155b |
children | 2b72f9bc4f06 |
comparison
equal
deleted
inserted
replaced
5088:8e206208db1f | 5089:bff60ecc02f9 |
---|---|
29 #include <stdlib.h> | 29 #include <stdlib.h> |
30 #include <string.h> | 30 #include <string.h> |
31 #include <unistd.h> | 31 #include <unistd.h> |
32 | 32 |
33 #include "avcodec.h" | 33 #include "avcodec.h" |
34 #include "bytestream.h" | |
34 | 35 |
35 #include "ulti_cb.h" | 36 #include "ulti_cb.h" |
36 | 37 |
37 typedef struct UltimotionDecodeContext { | 38 typedef struct UltimotionDecodeContext { |
38 AVCodecContext *avctx; | 39 AVCodecContext *avctx; |
303 } | 304 } |
304 break; | 305 break; |
305 | 306 |
306 case 2: | 307 case 2: |
307 if (modifier) { // unpack four luma samples | 308 if (modifier) { // unpack four luma samples |
308 tmp = (*buf++) << 16; | 309 tmp = bytestream_get_be24(&buf); |
309 tmp += (*buf++) << 8; | |
310 tmp += *buf++; | |
311 | 310 |
312 Y[0] = (tmp >> 18) & 0x3F; | 311 Y[0] = (tmp >> 18) & 0x3F; |
313 Y[1] = (tmp >> 12) & 0x3F; | 312 Y[1] = (tmp >> 12) & 0x3F; |
314 Y[2] = (tmp >> 6) & 0x3F; | 313 Y[2] = (tmp >> 6) & 0x3F; |
315 Y[3] = tmp & 0x3F; | 314 Y[3] = tmp & 0x3F; |
316 angle = 16; | 315 angle = 16; |
317 } else { // retrieve luma samples from codebook | 316 } else { // retrieve luma samples from codebook |
318 tmp = (*buf++) << 8; | 317 tmp = bytestream_get_be16(&buf); |
319 tmp += (*buf++); | |
320 | 318 |
321 angle = (tmp >> 12) & 0xF; | 319 angle = (tmp >> 12) & 0xF; |
322 tmp &= 0xFFF; | 320 tmp &= 0xFFF; |
323 tmp <<= 2; | 321 tmp <<= 2; |
324 Y[0] = s->ulti_codebook[tmp]; | 322 Y[0] = s->ulti_codebook[tmp]; |
330 | 328 |
331 case 3: | 329 case 3: |
332 if (modifier) { // all 16 luma samples | 330 if (modifier) { // all 16 luma samples |
333 uint8_t Luma[16]; | 331 uint8_t Luma[16]; |
334 | 332 |
335 tmp = (*buf++) << 16; | 333 tmp = bytestream_get_be24(&buf); |
336 tmp += (*buf++) << 8; | |
337 tmp += *buf++; | |
338 Luma[0] = (tmp >> 18) & 0x3F; | 334 Luma[0] = (tmp >> 18) & 0x3F; |
339 Luma[1] = (tmp >> 12) & 0x3F; | 335 Luma[1] = (tmp >> 12) & 0x3F; |
340 Luma[2] = (tmp >> 6) & 0x3F; | 336 Luma[2] = (tmp >> 6) & 0x3F; |
341 Luma[3] = tmp & 0x3F; | 337 Luma[3] = tmp & 0x3F; |
342 | 338 |
343 tmp = (*buf++) << 16; | 339 tmp = bytestream_get_be24(&buf); |
344 tmp += (*buf++) << 8; | |
345 tmp += *buf++; | |
346 Luma[4] = (tmp >> 18) & 0x3F; | 340 Luma[4] = (tmp >> 18) & 0x3F; |
347 Luma[5] = (tmp >> 12) & 0x3F; | 341 Luma[5] = (tmp >> 12) & 0x3F; |
348 Luma[6] = (tmp >> 6) & 0x3F; | 342 Luma[6] = (tmp >> 6) & 0x3F; |
349 Luma[7] = tmp & 0x3F; | 343 Luma[7] = tmp & 0x3F; |
350 | 344 |
351 tmp = (*buf++) << 16; | 345 tmp = bytestream_get_be24(&buf); |
352 tmp += (*buf++) << 8; | |
353 tmp += *buf++; | |
354 Luma[8] = (tmp >> 18) & 0x3F; | 346 Luma[8] = (tmp >> 18) & 0x3F; |
355 Luma[9] = (tmp >> 12) & 0x3F; | 347 Luma[9] = (tmp >> 12) & 0x3F; |
356 Luma[10] = (tmp >> 6) & 0x3F; | 348 Luma[10] = (tmp >> 6) & 0x3F; |
357 Luma[11] = tmp & 0x3F; | 349 Luma[11] = tmp & 0x3F; |
358 | 350 |
359 tmp = (*buf++) << 16; | 351 tmp = bytestream_get_be24(&buf); |
360 tmp += (*buf++) << 8; | |
361 tmp += *buf++; | |
362 Luma[12] = (tmp >> 18) & 0x3F; | 352 Luma[12] = (tmp >> 18) & 0x3F; |
363 Luma[13] = (tmp >> 12) & 0x3F; | 353 Luma[13] = (tmp >> 12) & 0x3F; |
364 Luma[14] = (tmp >> 6) & 0x3F; | 354 Luma[14] = (tmp >> 6) & 0x3F; |
365 Luma[15] = tmp & 0x3F; | 355 Luma[15] = tmp & 0x3F; |
366 | 356 |