summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-11 02:39:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-11 03:42:43 +0200
commit41f55277fafeec4f1b3202967bd0ab120948dd69 (patch)
treef239ff85401c38aa12a243384bdaf2ad48afaffb /libavcodec/vc1dsp.c
parentfbb8468f205aa118b3701db56b134f3f173a13ad (diff)
parent4c7a232fc81fdbdee279ab819a255f624a22b083 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (34 commits) h264: reset h->ref_count in case of errors in ff_h264_decode_ref_pic_list_reordering() error_resilience: fix the check for missing references in ff_er_frame_end() for H264 4xm: prevent NULL dereference with invalid huffman table 4xmdemux: prevent use of uninitialized memory 4xm: clear FF_INPUT_BUFFER_PADDING_SIZE bytes in temporary buffers ptx: check for out of bound reads tiffdec: fix out of bound reads/writes eacmv: check for out of bound reads eacmv: fix potential pointer arithmetic overflows adpcm: fix out of bound reads due to integer overflow anm: prevent infinite loop avsdemux: check for out of bound writes avs: check for out of bound reads avsdemux: check for corrupted data AVOptions: refactor set_number/write_number AVOptions: cosmetics, rename static av_set_number2() to write_number(). AVOptions: cosmetics, move and rename static av_set_number(). AVOptions: split av_set_string3 into opt type-specific functions avidec: fix signed overflow in avi_sync() mxfdec: Fix some buffer overreads caused by the misuse of AVPacket related functions. ... Conflicts: Changelog configure libavcodec/ptx.c libavcodec/ra144.c libavcodec/vaapi_vc1.c libavcodec/vc1.c libavcodec/version.h libavformat/4xm.c libavformat/avidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r--libavcodec/vc1dsp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index 5d6ee92fd7..a9a7dff761 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -688,6 +688,26 @@ static void put_no_rnd_vc1_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
}
}
+static void put_no_rnd_vc1_chroma_mc4_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){
+ const int A=(8-x)*(8-y);
+ const int B=( x)*(8-y);
+ const int C=(8-x)*( y);
+ const int D=( x)*( y);
+ int i;
+
+ assert(x<8 && y<8 && x>=0 && y>=0);
+
+ for(i=0; i<h; i++)
+ {
+ dst[0] = (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + 32 - 4) >> 6;
+ dst[1] = (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + 32 - 4) >> 6;
+ dst[2] = (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + 32 - 4) >> 6;
+ dst[3] = (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + 32 - 4) >> 6;
+ dst+= stride;
+ src+= stride;
+ }
+}
+
#define avg2(a,b) ((a+b+1)>>1)
static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){
const int A=(8-x)*(8-y);
@@ -829,6 +849,7 @@ av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) {
dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= put_no_rnd_vc1_chroma_mc8_c;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= avg_no_rnd_vc1_chroma_mc8_c;
+ dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = put_no_rnd_vc1_chroma_mc4_c;
#if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER
dsp->sprite_h = sprite_h_c;