Commit 02bfaaa8 authored by michael's avatar michael

1/4 resolution decoding


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3509 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 57549c20
...@@ -17,7 +17,7 @@ extern "C" { ...@@ -17,7 +17,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000409 #define FFMPEG_VERSION_INT 0x000409
#define FFMPEG_VERSION "0.4.9-pre1" #define FFMPEG_VERSION "0.4.9-pre1"
#define LIBAVCODEC_BUILD 4722 #define LIBAVCODEC_BUILD 4723
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION #define LIBAVCODEC_VERSION FFMPEG_VERSION
...@@ -1111,7 +1111,6 @@ typedef struct AVCodecContext { ...@@ -1111,7 +1111,6 @@ typedef struct AVCodecContext {
#define FF_IDCT_ALTIVEC 8 #define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9 #define FF_IDCT_SH4 9
#define FF_IDCT_SIMPLEARM 10 #define FF_IDCT_SIMPLEARM 10
#define FF_IDCT_INT4 11
/** /**
* slice count. * slice count.
......
...@@ -464,6 +464,22 @@ static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels ...@@ -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, static void put_signed_pixels_clamped_c(const DCTELEM *block,
uint8_t *restrict pixels, uint8_t *restrict pixels,
int line_size) int line_size)
...@@ -522,6 +538,21 @@ static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels ...@@ -522,6 +538,21 @@ static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *restrict pixels
block += 8; 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 #if 0
#define PIXOP2(OPNAME, OP) \ #define PIXOP2(OPNAME, OP) \
...@@ -3340,6 +3371,17 @@ static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block) ...@@ -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); 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 */ /* init static data */
void dsputil_static_init(void) void dsputil_static_init(void)
{ {
...@@ -3383,6 +3425,11 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) ...@@ -3383,6 +3425,11 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct_add= ff_jref_idct4_add; c->idct_add= ff_jref_idct4_add;
c->idct = j_rev_dct4; c->idct = j_rev_dct4;
c->idct_permutation_type= FF_NO_IDCT_PERM; 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{ }else{
if(avctx->idct_algo==FF_IDCT_INT){ if(avctx->idct_algo==FF_IDCT_INT){
c->idct_put= ff_jref_idct_put; c->idct_put= ff_jref_idct_put;
......
...@@ -43,6 +43,7 @@ void ff_fdct248_islow (DCTELEM *data); ...@@ -43,6 +43,7 @@ void ff_fdct248_islow (DCTELEM *data);
void j_rev_dct (DCTELEM *data); void j_rev_dct (DCTELEM *data);
void j_rev_dct4 (DCTELEM *data); void j_rev_dct4 (DCTELEM *data);
void j_rev_dct2 (DCTELEM *data);
void ff_fdct_mmx(DCTELEM *block); void ff_fdct_mmx(DCTELEM *block);
void ff_fdct_mmx2(DCTELEM *block); void ff_fdct_mmx2(DCTELEM *block);
......
...@@ -1203,8 +1203,6 @@ void j_rev_dct4(DCTBLOCK data) ...@@ -1203,8 +1203,6 @@ void j_rev_dct4(DCTBLOCK data)
register int *idataptr = (int*)dataptr; register int *idataptr = (int*)dataptr;
/* WARNING: we do the same permutation as MMX idct to simplify the
video core */
d0 = dataptr[0]; d0 = dataptr[0];
d2 = dataptr[1]; d2 = dataptr[1];
d4 = dataptr[2]; d4 = dataptr[2];
...@@ -1627,6 +1625,20 @@ void j_rev_dct4(DCTBLOCK data) ...@@ -1627,6 +1625,20 @@ void j_rev_dct4(DCTBLOCK data)
} }
} }
void j_rev_dct2(DCTBLOCK data){
int d00, d01, d10, d11;
data[0] += 4;
d00 = data[0+0*DCTSTRIDE] + data[1+0*DCTSTRIDE];
d01 = data[0+0*DCTSTRIDE] - data[1+0*DCTSTRIDE];
d10 = data[0+1*DCTSTRIDE] + data[1+1*DCTSTRIDE];
d11 = data[0+1*DCTSTRIDE] - data[1+1*DCTSTRIDE];
data[0+0*DCTSTRIDE]= (d00 + d10)>>3;
data[1+0*DCTSTRIDE]= (d01 + d11)>>3;
data[0+1*DCTSTRIDE]= (d00 - d10)>>3;
data[1+1*DCTSTRIDE]= (d01 - d11)>>3;
}
#undef FIX #undef FIX
#undef CONST_BITS #undef CONST_BITS
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment