Mercurial > libavcodec.hg
comparison dsputil.c @ 2257:5f64a30339e5 libavcodec
1/4 resolution decoding
author | michael |
---|---|
date | Sun, 26 Sep 2004 00:18:12 +0000 |
parents | 7e0b2e86afa9 |
children | 12e75af1d44c |
comparison
equal
deleted
inserted
replaced
2256:7e0b2e86afa9 | 2257:5f64a30339e5 |
---|---|
462 pixels += line_size; | 462 pixels += line_size; |
463 block += 8; | 463 block += 8; |
464 } | 464 } |
465 } | 465 } |
466 | 466 |
467 static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels, | |
468 int line_size) | |
469 { | |
470 int i; | |
471 uint8_t *cm = cropTbl + MAX_NEG_CROP; | |
472 | |
473 /* read the pixels */ | |
474 for(i=0;i<2;i++) { | |
475 pixels[0] = cm[block[0]]; | |
476 pixels[1] = cm[block[1]]; | |
477 | |
478 pixels += line_size; | |
479 block += 8; | |
480 } | |
481 } | |
482 | |
467 static void put_signed_pixels_clamped_c(const DCTELEM *block, | 483 static void put_signed_pixels_clamped_c(const DCTELEM *block, |
468 uint8_t *restrict pixels, | 484 uint8_t *restrict pixels, |
469 int line_size) | 485 int line_size) |
470 { | 486 { |
471 int i, j; | 487 int i, j; |
516 for(i=0;i<4;i++) { | 532 for(i=0;i<4;i++) { |
517 pixels[0] = cm[pixels[0] + block[0]]; | 533 pixels[0] = cm[pixels[0] + block[0]]; |
518 pixels[1] = cm[pixels[1] + block[1]]; | 534 pixels[1] = cm[pixels[1] + block[1]]; |
519 pixels[2] = cm[pixels[2] + block[2]]; | 535 pixels[2] = cm[pixels[2] + block[2]]; |
520 pixels[3] = cm[pixels[3] + block[3]]; | 536 pixels[3] = cm[pixels[3] + block[3]]; |
537 pixels += line_size; | |
538 block += 8; | |
539 } | |
540 } | |
541 | |
542 static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels, | |
543 int line_size) | |
544 { | |
545 int i; | |
546 uint8_t *cm = cropTbl + MAX_NEG_CROP; | |
547 | |
548 /* read the pixels */ | |
549 for(i=0;i<2;i++) { | |
550 pixels[0] = cm[pixels[0] + block[0]]; | |
551 pixels[1] = cm[pixels[1] + block[1]]; | |
521 pixels += line_size; | 552 pixels += line_size; |
522 block += 8; | 553 block += 8; |
523 } | 554 } |
524 } | 555 } |
525 #if 0 | 556 #if 0 |
3338 { | 3369 { |
3339 j_rev_dct4 (block); | 3370 j_rev_dct4 (block); |
3340 add_pixels_clamped4_c(block, dest, line_size); | 3371 add_pixels_clamped4_c(block, dest, line_size); |
3341 } | 3372 } |
3342 | 3373 |
3374 static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block) | |
3375 { | |
3376 j_rev_dct2 (block); | |
3377 put_pixels_clamped2_c(block, dest, line_size); | |
3378 } | |
3379 static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block) | |
3380 { | |
3381 j_rev_dct2 (block); | |
3382 add_pixels_clamped2_c(block, dest, line_size); | |
3383 } | |
3384 | |
3343 /* init static data */ | 3385 /* init static data */ |
3344 void dsputil_static_init(void) | 3386 void dsputil_static_init(void) |
3345 { | 3387 { |
3346 int i; | 3388 int i; |
3347 | 3389 |
3380 | 3422 |
3381 if(avctx->lowres==1){ | 3423 if(avctx->lowres==1){ |
3382 c->idct_put= ff_jref_idct4_put; | 3424 c->idct_put= ff_jref_idct4_put; |
3383 c->idct_add= ff_jref_idct4_add; | 3425 c->idct_add= ff_jref_idct4_add; |
3384 c->idct = j_rev_dct4; | 3426 c->idct = j_rev_dct4; |
3427 c->idct_permutation_type= FF_NO_IDCT_PERM; | |
3428 }else if(avctx->lowres==2){ | |
3429 c->idct_put= ff_jref_idct2_put; | |
3430 c->idct_add= ff_jref_idct2_add; | |
3431 c->idct = j_rev_dct2; | |
3385 c->idct_permutation_type= FF_NO_IDCT_PERM; | 3432 c->idct_permutation_type= FF_NO_IDCT_PERM; |
3386 }else{ | 3433 }else{ |
3387 if(avctx->idct_algo==FF_IDCT_INT){ | 3434 if(avctx->idct_algo==FF_IDCT_INT){ |
3388 c->idct_put= ff_jref_idct_put; | 3435 c->idct_put= ff_jref_idct_put; |
3389 c->idct_add= ff_jref_idct_add; | 3436 c->idct_add= ff_jref_idct_add; |