X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdsputil.c;h=ad1bfd482f58c6ea5ac80569a3911766b3f3a315;hb=7f12a9780e2129b788a42574f8e71dc8c22e86d1;hp=3587ebf8b2c915ee7d730eef6ccbd8afc8857c6c;hpb=609009913de9042fc61603f4b834c4fe2cfdb752;p=ffmpeg diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 3587ebf8b2c..ad1bfd482f5 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer */ @@ -30,6 +30,7 @@ #include "mpegvideo.h" #include "simple_idct.h" #include "faandct.h" +#include "snow.h" /* snow.c */ void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count); @@ -62,7 +63,7 @@ const uint8_t ff_zigzag248_direct[64] = { }; /* not permutated inverse zigzag_direct + 1 for MMX quantizer */ -uint16_t __align8 inv_zigzag_direct16[64] = {0, }; +DECLARE_ALIGNED_8(uint16_t, inv_zigzag_direct16[64]) = {0, }; const uint8_t ff_alternate_horizontal_scan[64] = { 0, 1, 2, 3, 8, 9, 16, 17, @@ -1143,7 +1144,7 @@ static void gmc1_c(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y } } -static void gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, +void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height) { int y, vx, vy; @@ -1487,6 +1488,17 @@ H264_CHROMA_MC(avg_ , op_avg) #undef op_avg #undef op_put +static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h) +{ + int i; + for(i=0; i> (log2_denom+1)) #define H264_WEIGHT(W,H) \ static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \ - int attribute_unused x, y; \ + int y; \ offset <<= log2_denom; \ if(log2_denom) offset += 1<<(log2_denom-1); \ for(y=0; y> 1; \ - offset = ((offset << 1) + 1) << log2_denom; \ +static void biweight_h264_pixels ## W ## x ## H ## _c(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset){ \ + int y; \ + offset = ((offset + 1) | 1) << log2_denom; \ for(y=0; yintra_scantable.permutated; - uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8]; - uint64_t __align8 aligned_bak[stride]; + DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); + DECLARE_ALIGNED_8 (uint64_t, aligned_bak[stride]); DCTELEM * const temp= (DCTELEM*)aligned_temp; uint8_t * const bak= (uint8_t*)aligned_bak; int i, last, run, bits, level, distoration, start_i; @@ -3522,7 +3596,7 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; const uint8_t *scantable= s->intra_scantable.permutated; - uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8]; + DECLARE_ALIGNED_8 (uint64_t, aligned_temp[sizeof(DCTELEM)*64/8]); DCTELEM * const temp= (DCTELEM*)aligned_temp; int i, last, run, bits, level, start_i; const int esc_length= s->ac_esc_length; @@ -3699,6 +3773,8 @@ static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) dest[0] = cm[dest[0] + ((block[0] + 4)>>3)]; } +static void just_return() { return; } + /* init static data */ void dsputil_static_init(void) { @@ -3778,6 +3854,8 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->h264_idct_add= ff_h264_idct_add_c; c->h264_idct8_add= ff_h264_idct8_add_c; + c->h264_idct_dc_add= ff_h264_idct_dc_add_c; + c->h264_idct8_dc_add= ff_h264_idct8_dc_add_c; c->get_pixels = get_pixels_c; c->diff_pixels = diff_pixels_c; @@ -3787,7 +3865,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->add_pixels8 = add_pixels8_c; c->add_pixels4 = add_pixels4_c; c->gmc1 = gmc1_c; - c->gmc = gmc_c; + c->gmc = ff_gmc_c; c->clear_blocks = clear_blocks_c; c->pix_sum = pix_sum_c; c->pix_norm1 = pix_norm1_c; @@ -3879,6 +3957,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) dspfunc(put_h264_qpel, 0, 16); dspfunc(put_h264_qpel, 1, 8); dspfunc(put_h264_qpel, 2, 4); + dspfunc(put_h264_qpel, 3, 2); dspfunc(avg_h264_qpel, 0, 16); dspfunc(avg_h264_qpel, 1, 8); dspfunc(avg_h264_qpel, 2, 4); @@ -3971,6 +4050,19 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) c->try_8x8basis= try_8x8basis_c; c->add_8x8basis= add_8x8basis_c; +#ifdef CONFIG_SNOW_ENCODER + c->vertical_compose97i = ff_snow_vertical_compose97i; + c->horizontal_compose97i = ff_snow_horizontal_compose97i; + c->inner_add_yblock = ff_snow_inner_add_yblock; +#endif + + c->shrink[0]= ff_img_copy_plane; + c->shrink[1]= ff_shrink22; + c->shrink[2]= ff_shrink44; + c->shrink[3]= ff_shrink88; + + c->prefetch= just_return; + #ifdef HAVE_MMX dsputil_init_mmx(c, avctx); #endif