summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-21 16:27:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-21 16:28:53 +0200
commitf93f6963babf08a7bcf85b9a57f37266dc0a4ae0 (patch)
treed9729ad7db8cb9f9a6a5483ac960ef7a56310072 /libavcodec/dsputil.c
parent8c2863b87f651bfce061d5b0e03cd756b049a553 (diff)
parente5985185d2eda942333ebbb72bd7d043ffe40be7 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rv30: return AVERROR(EINVAL) instead of EINVAL build: add -L flags before existing LDFLAGS simple_idct: whitespace cosmetics simple_idct: make repeated code a macro dsputil: remove huge #if 0 block simple_idct: change 10-bit add/put stride from pixels to bytes dsputil: allow 9/10-bit functions for non-h264 codecs dnxhd: rename some data tables dnxhdenc: remove inline from function only called through pointer dnxhdenc: whitespace cosmetics swscale: mark YUV422P10(LE,BE) as supported for output configure: add -xc99 to LDFLAGS for Sun CC Remove unused and non-compiling vestigial g729 decoder Remove unused code under G729_BITEXACT #ifdef. mpegvideo: fix invalid picture unreferencing. dsputil: Remove extra blank line at end. dsputil: Replace a LONG_MAX check with HAVE_FAST_64BIT. simple_idct: add 10-bit version Conflicts: Makefile libavcodec/g729data.h libavcodec/g729dec.c libavcodec/rv30.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 26e23cd84b..5c5f9db47c 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -184,7 +184,7 @@ static int pix_norm1_c(uint8_t * pix, int line_size)
s += sq[pix[6]];
s += sq[pix[7]];
#else
-#if LONG_MAX > 2147483647
+#if HAVE_FAST_64BIT
register uint64_t x=*(uint64_t*)pix;
s += sq[x&0xff];
s += sq[(x>>8)&0xff];
@@ -2225,7 +2225,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
s->dct_unquantize_inter(s, temp, 0, s->qscale);
- ff_simple_idct(temp); //FIXME
+ ff_simple_idct_8(temp); //FIXME
for(i=0; i<64; i++)
sum+= (temp[i]-bak[i])*(temp[i]-bak[i]);
@@ -2866,6 +2866,12 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct = j_rev_dct1;
c->idct_permutation_type= FF_NO_IDCT_PERM;
}else{
+ if (avctx->bits_per_raw_sample == 10) {
+ c->idct_put = ff_simple_idct_put_10;
+ c->idct_add = ff_simple_idct_add_10;
+ c->idct = ff_simple_idct_10;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ } else {
if(avctx->idct_algo==FF_IDCT_INT){
c->idct_put= ff_jref_idct_put;
c->idct_add= ff_jref_idct_add;
@@ -2896,11 +2902,12 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct_put = ff_bink_idct_put_c;
c->idct_permutation_type = FF_NO_IDCT_PERM;
}else{ //accurate/default
- c->idct_put= ff_simple_idct_put;
- c->idct_add= ff_simple_idct_add;
- c->idct = ff_simple_idct;
+ c->idct_put = ff_simple_idct_put_8;
+ c->idct_add = ff_simple_idct_add_8;
+ c->idct = ff_simple_idct_8;
c->idct_permutation_type= FF_NO_IDCT_PERM;
}
+ }
}
c->get_pixels = get_pixels_c;
@@ -3169,21 +3176,18 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
dspfunc2(avg_h264_qpel, 1, 8, depth);\
dspfunc2(avg_h264_qpel, 2, 4, depth);
- if (avctx->codec_id != CODEC_ID_H264 || avctx->bits_per_raw_sample == 8) {
- BIT_DEPTH_FUNCS(8)
- } else {
- switch (avctx->bits_per_raw_sample) {
- case 9:
- BIT_DEPTH_FUNCS(9)
- break;
- case 10:
- BIT_DEPTH_FUNCS(10)
- break;
- default:
- av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", avctx->bits_per_raw_sample);
- BIT_DEPTH_FUNCS(8)
- break;
- }
+ switch (avctx->bits_per_raw_sample) {
+ case 9:
+ BIT_DEPTH_FUNCS(9);
+ break;
+ case 10:
+ BIT_DEPTH_FUNCS(10);
+ break;
+ default:
+ av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", avctx->bits_per_raw_sample);
+ case 8:
+ BIT_DEPTH_FUNCS(8);
+ break;
}
@@ -3243,4 +3247,3 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
}
}
-