summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-22 11:56:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-22 12:08:52 +0200
commit4095fa903830f8395a26d6ee38c77ad6333a4f5e (patch)
tree828ada22309e543a181997b63c6ffca6868731ac /libavcodec/dsputil.c
parent657eac048eb267d781de83849fe7616d29320832 (diff)
parentbb32fded3623a20ff8999c2924315841c08c985c (diff)
downloadffmpeg-4095fa903830f8395a26d6ee38c77ad6333a4f5e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: dnxhddec: optimise dnxhd_decode_dct_block() rtp: remove disabled code eac3enc: use different numbers of blocks per frame to allow higher bitrates dnxhd: add regression test for 10-bit dnxhd: 10-bit support dsputil: update per-arch init funcs for non-h264 high bit depth dsputil: template get_pixels() for different bit depths dsputil: create 16/32-bit dctcoef versions of some functions jfdctint: add 10-bit version mov: add clcp type track as Subtitle stream. mpeg4: add Mpeg4 Profiles names. mpeg4: decode Level Profile for MPEG4 Part 2. ffprobe: display bitstream level. imgconvert: remove unused glue and xglue macros Conflicts: libavcodec/dsputil_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c72
1 files changed, 33 insertions, 39 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 5c5f9db47c..6f8d8a099f 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -306,25 +306,6 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
return s;
}
-static void get_pixels_c(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
-{
- int i;
-
- /* read the pixels */
- for(i=0;i<8;i++) {
- block[0] = pixels[0];
- block[1] = pixels[1];
- block[2] = pixels[2];
- block[3] = pixels[3];
- block[4] = pixels[4];
- block[5] = pixels[5];
- block[6] = pixels[6];
- block[7] = pixels[7];
- pixels += line_size;
- block += 8;
- }
-}
-
static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride){
int i;
@@ -2836,17 +2817,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
@@ -2910,7 +2896,6 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
}
}
- c->get_pixels = get_pixels_c;
c->diff_pixels = diff_pixels_c;
c->put_pixels_clamped = ff_put_pixels_clamped_c;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_c;
@@ -3138,13 +3123,14 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->PFX ## _pixels_tab[IDX][15] = FUNCC(PFX ## NUM ## _mc33, depth)
-#define BIT_DEPTH_FUNCS(depth)\
+#define BIT_DEPTH_FUNCS(depth, dct)\
+ c->get_pixels = FUNCC(get_pixels ## dct , depth);\
c->draw_edges = FUNCC(draw_edges , depth);\
c->emulated_edge_mc = FUNC (ff_emulated_edge_mc , depth);\
- c->clear_block = FUNCC(clear_block , depth);\
- c->clear_blocks = FUNCC(clear_blocks , depth);\
- c->add_pixels8 = FUNCC(add_pixels8 , depth);\
- c->add_pixels4 = FUNCC(add_pixels4 , depth);\
+ c->clear_block = FUNCC(clear_block ## dct , depth);\
+ c->clear_blocks = FUNCC(clear_blocks ## dct , depth);\
+ c->add_pixels8 = FUNCC(add_pixels8 ## dct , depth);\
+ c->add_pixels4 = FUNCC(add_pixels4 ## dct , depth);\
c->put_no_rnd_pixels_l2[0] = FUNCC(put_no_rnd_pixels16_l2, depth);\
c->put_no_rnd_pixels_l2[1] = FUNCC(put_no_rnd_pixels8_l2 , depth);\
\
@@ -3178,15 +3164,23 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
switch (avctx->bits_per_raw_sample) {
case 9:
- BIT_DEPTH_FUNCS(9);
+ if (c->dct_bits == 32) {
+ BIT_DEPTH_FUNCS(9, _32);
+ } else {
+ BIT_DEPTH_FUNCS(9, _16);
+ }
break;
case 10:
- BIT_DEPTH_FUNCS(10);
+ if (c->dct_bits == 32) {
+ BIT_DEPTH_FUNCS(10, _32);
+ } else {
+ BIT_DEPTH_FUNCS(10, _16);
+ }
break;
default:
av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", avctx->bits_per_raw_sample);
case 8:
- BIT_DEPTH_FUNCS(8);
+ BIT_DEPTH_FUNCS(8, _16);
break;
}