X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvc1dsp.c;h=5e79736a50fda2874d622c26f2972aa31c2bb01e;hb=49b19191bc0e23fea139b79b2c42969bc0c501d9;hp=5420e7e260bb77633e5789f3cd7e69a1f07d49e8;hpb=0e58865d6e86bbb664d92311c0f81c65e0213c35;p=ffmpeg diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 5420e7e260b..5e79736a50f 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -130,7 +130,7 @@ static av_always_inline int vc1_filter_line(uint8_t* src, int stride, int pq){ * @param pq block quantizer * @see 8.6 */ -static void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq) +static inline void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq) { int i; int filt3; @@ -146,8 +146,58 @@ static void vc1_loop_filter(uint8_t* src, int step, int stride, int len, int pq) } } +static void vc1_v_loop_filter4_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, 1, stride, 4, pq); +} + +static void vc1_h_loop_filter4_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, stride, 1, 4, pq); +} + +static void vc1_v_loop_filter8_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, 1, stride, 8, pq); +} + +static void vc1_h_loop_filter8_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, stride, 1, 8, pq); +} + +static void vc1_v_loop_filter16_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, 1, stride, 16, pq); +} + +static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq) +{ + vc1_loop_filter(src, stride, 1, 16, pq); +} + /** Do inverse transform on 8x8 block */ +static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i; + int dc = block[0]; + const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + dc = (3 * dc + 1) >> 1; + dc = (3 * dc + 16) >> 5; + for(i = 0; i < 8; i++){ + dest[0] = cm[dest[0]+dc]; + dest[1] = cm[dest[1]+dc]; + dest[2] = cm[dest[2]+dc]; + dest[3] = cm[dest[3]+dc]; + dest[4] = cm[dest[4]+dc]; + dest[5] = cm[dest[5]+dc]; + dest[6] = cm[dest[6]+dc]; + dest[7] = cm[dest[7]+dc]; + dest += linesize; + } +} + static void vc1_inv_trans_8x8_c(DCTELEM block[64]) { int i; @@ -219,6 +269,26 @@ static void vc1_inv_trans_8x8_c(DCTELEM block[64]) /** Do inverse transform on 8x4 part of block */ +static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i; + int dc = block[0]; + const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + dc = ( 3 * dc + 1) >> 1; + dc = (17 * dc + 64) >> 7; + for(i = 0; i < 4; i++){ + dest[0] = cm[dest[0]+dc]; + dest[1] = cm[dest[1]+dc]; + dest[2] = cm[dest[2]+dc]; + dest[3] = cm[dest[3]+dc]; + dest[4] = cm[dest[4]+dc]; + dest[5] = cm[dest[5]+dc]; + dest[6] = cm[dest[6]+dc]; + dest[7] = cm[dest[7]+dc]; + dest += linesize; + } +} + static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; @@ -276,6 +346,22 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) /** Do inverse transform on 4x8 parts of block */ +static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i; + int dc = block[0]; + const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + dc = (17 * dc + 4) >> 3; + dc = (12 * dc + 64) >> 7; + for(i = 0; i < 8; i++){ + dest[0] = cm[dest[0]+dc]; + dest[1] = cm[dest[1]+dc]; + dest[2] = cm[dest[2]+dc]; + dest[3] = cm[dest[3]+dc]; + dest += linesize; + } +} + static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; @@ -333,6 +419,22 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) /** Do inverse transform on 4x4 part of block */ +static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +{ + int i; + int dc = block[0]; + const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + dc = (17 * dc + 4) >> 3; + dc = (17 * dc + 64) >> 7; + for(i = 0; i < 4; i++){ + dest[0] = cm[dest[0]+dc]; + dest[1] = cm[dest[1]+dc]; + dest[2] = cm[dest[2]+dc]; + dest[3] = cm[dest[3]+dc]; + dest += linesize; + } +} + static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; @@ -515,9 +617,18 @@ void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) { dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c; dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c; dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c; + dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_c; + dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_c; + dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_c; + dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_c; dsp->vc1_h_overlap = vc1_h_overlap_c; dsp->vc1_v_overlap = vc1_v_overlap_c; - dsp->vc1_loop_filter = vc1_loop_filter; + dsp->vc1_v_loop_filter4 = vc1_v_loop_filter4_c; + dsp->vc1_h_loop_filter4 = vc1_h_loop_filter4_c; + dsp->vc1_v_loop_filter8 = vc1_v_loop_filter8_c; + dsp->vc1_h_loop_filter8 = vc1_h_loop_filter8_c; + dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_c; + dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_c; dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c; dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;