Skip to content

Commit

Permalink
jfdctint: add 10-bit version
Browse files Browse the repository at this point in the history
Signed-off-by: Mans Rullgard <mans@mansr.com>
  • Loading branch information
mansr committed Jul 21, 2011
1 parent 73c0dd9 commit 0a72533
Show file tree
Hide file tree
Showing 9 changed files with 454 additions and 416 deletions.
6 changes: 3 additions & 3 deletions libavcodec/bfin/dsputil_bfin.c
Expand Up @@ -253,10 +253,10 @@ void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx )
/* c->put_no_rnd_pixels_tab[0][3] = ff_bfin_put_pixels16_xy2_nornd; */
}

if (avctx->dct_algo == FF_DCT_AUTO)
c->fdct = ff_bfin_fdct;

if (avctx->bits_per_raw_sample <= 8) {
if (avctx->dct_algo == FF_DCT_AUTO)
c->fdct = ff_bfin_fdct;

if (avctx->idct_algo == FF_IDCT_VP3) {
c->idct_permutation_type = FF_NO_IDCT_PERM;
c->idct = ff_bfin_vp3_idct;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/dct-test.c
Expand Up @@ -88,7 +88,7 @@ static const struct algo fdct_tab[] = {
{ "REF-DBL", ff_ref_fdct, NO_PERM },
{ "FAAN", ff_faandct, FAAN_SCALE },
{ "IJG-AAN-INT", fdct_ifast, SCALE_PERM },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow, NO_PERM },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow_8, NO_PERM },

#if HAVE_MMX
{ "MMX", ff_fdct_mmx, NO_PERM, AV_CPU_FLAG_MMX },
Expand Down
27 changes: 16 additions & 11 deletions libavcodec/dsputil.c
Expand Up @@ -2848,17 +2848,22 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
ff_check_alignment();

#if CONFIG_ENCODERS
if(avctx->dct_algo==FF_DCT_FASTINT) {
c->fdct = fdct_ifast;
c->fdct248 = fdct_ifast248;
}
else if(avctx->dct_algo==FF_DCT_FAAN) {
c->fdct = ff_faandct;
c->fdct248 = ff_faandct248;
}
else {
c->fdct = ff_jpeg_fdct_islow; //slow/accurate/default
c->fdct248 = ff_fdct248_islow;
if (avctx->bits_per_raw_sample == 10) {
c->fdct = ff_jpeg_fdct_islow_10;
c->fdct248 = ff_fdct248_islow_10;
} else {
if(avctx->dct_algo==FF_DCT_FASTINT) {
c->fdct = fdct_ifast;
c->fdct248 = fdct_ifast248;
}
else if(avctx->dct_algo==FF_DCT_FAAN) {
c->fdct = ff_faandct;
c->fdct248 = ff_faandct248;
}
else {
c->fdct = ff_jpeg_fdct_islow_8; //slow/accurate/default
c->fdct248 = ff_fdct248_islow_8;
}
}
#endif //CONFIG_ENCODERS

Expand Down
6 changes: 4 additions & 2 deletions libavcodec/dsputil.h
Expand Up @@ -40,8 +40,10 @@ typedef short DCTELEM;

void fdct_ifast (DCTELEM *data);
void fdct_ifast248 (DCTELEM *data);
void ff_jpeg_fdct_islow (DCTELEM *data);
void ff_fdct248_islow (DCTELEM *data);
void ff_jpeg_fdct_islow_8(DCTELEM *data);
void ff_jpeg_fdct_islow_10(DCTELEM *data);
void ff_fdct248_islow_8(DCTELEM *data);
void ff_fdct248_islow_10(DCTELEM *data);

void j_rev_dct (DCTELEM *data);
void j_rev_dct4 (DCTELEM *data);
Expand Down

0 comments on commit 0a72533

Please sign in to comment.