diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-09-26 00:18:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-09-26 00:18:12 +0000 |
commit | 9ca358b9511a412a4b45880ce78cd7479087ad92 (patch) | |
tree | f36a9c02d3b3cf30acca2c6c27806dcc275c9b86 /libavcodec/dsputil.c | |
parent | 8cbd529f12203050780025dfae837e50591d3145 (diff) | |
download | ffmpeg-9ca358b9511a412a4b45880ce78cd7479087ad92.tar.gz |
1/4 resolution decoding
Originally committed as revision 3509 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 8b95ff2e6c..9bf409d65e 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -464,6 +464,22 @@ static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels } } +static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels, + int line_size) +{ + int i; + uint8_t *cm = cropTbl + MAX_NEG_CROP; + + /* read the pixels */ + for(i=0;i<2;i++) { + pixels[0] = cm[block[0]]; + pixels[1] = cm[block[1]]; + + pixels += line_size; + block += 8; + } +} + static void put_signed_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, int line_size) @@ -522,6 +538,21 @@ static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels block += 8; } } + +static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels, + int line_size) +{ + int i; + uint8_t *cm = cropTbl + MAX_NEG_CROP; + + /* read the pixels */ + for(i=0;i<2;i++) { + pixels[0] = cm[pixels[0] + block[0]]; + pixels[1] = cm[pixels[1] + block[1]]; + pixels += line_size; + block += 8; + } +} #if 0 #define PIXOP2(OPNAME, OP) \ @@ -3340,6 +3371,17 @@ static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block) add_pixels_clamped4_c(block, dest, line_size); } +static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block) +{ + j_rev_dct2 (block); + put_pixels_clamped2_c(block, dest, line_size); +} +static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block) +{ + j_rev_dct2 (block); + add_pixels_clamped2_c(block, dest, line_size); +} + /* init static data */ void dsputil_static_init(void) { @@ -3383,6 +3425,11 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->idct_add= ff_jref_idct4_add; c->idct = j_rev_dct4; c->idct_permutation_type= FF_NO_IDCT_PERM; + }else if(avctx->lowres==2){ + c->idct_put= ff_jref_idct2_put; + c->idct_add= ff_jref_idct2_add; + c->idct = j_rev_dct2; + c->idct_permutation_type= FF_NO_IDCT_PERM; }else{ if(avctx->idct_algo==FF_IDCT_INT){ c->idct_put= ff_jref_idct_put; |