]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mlib/dsputil_mlib.c
Merge remote branch 'qatar/master'
[ffmpeg] / libavcodec / mlib / dsputil_mlib.c
index 98dc4cd926542f299cac58f2d8300424dd9efc42..3b2d693d88a1aac475d5cea3d7ca066f1d899a0a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sun mediaLib optimized DSP utils
- * Copyright (c) 2001 Fabrice Bellard.
+ * Copyright (c) 2001 Fabrice Bellard
  *
  * This file is part of FFmpeg.
  *
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "../dsputil.h"
-#include "../mpegvideo.h"
+#include "libavcodec/dsputil.h"
+#include "libavcodec/mpegvideo.h"
 
 #include <mlib_types.h>
 #include <mlib_status.h>
@@ -374,7 +374,7 @@ static void avg_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
 
 /* swap byte order of a buffer */
 
-static void bswap_buf_mlib(uint32_t *dst, uint32_t *src, int w)
+static void bswap_buf_mlib(uint32_t *dst, const uint32_t *src, int w)
 {
   mlib_VectorReverseByteOrder_U32_U32(dst, src, w);
 }
@@ -384,7 +384,7 @@ static void bswap_buf_mlib(uint32_t *dst, uint32_t *src, int w)
 static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
 {
     int i;
-    uint8_t *cm = cropTbl + MAX_NEG_CROP;
+    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
 
     mlib_VideoIDCT8x8_S16_S16 (data, data);
 
@@ -421,10 +421,13 @@ static void ff_fdct_mlib(DCTELEM *data)
 
 void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
 {
+    const int h264_high_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
+
     c->get_pixels  = get_pixels_mlib;
     c->diff_pixels = diff_pixels_mlib;
     c->add_pixels_clamped = add_pixels_clamped_mlib;
 
+    if (!h264_high_depth) {
     c->put_pixels_tab[0][0] = put_pixels16_mlib;
     c->put_pixels_tab[0][1] = put_pixels16_x2_mlib;
     c->put_pixels_tab[0][2] = put_pixels16_y2_mlib;
@@ -445,6 +448,7 @@ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
 
     c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib;
     c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
+    }
 
     c->bswap_buf = bswap_buf_mlib;
 }
@@ -455,7 +459,7 @@ void MPV_common_init_mlib(MpegEncContext *s)
         s->dsp.fdct = ff_fdct_mlib;
     }
 
-    if(s->avctx->idct_algo==FF_IDCT_AUTO || s->avctx->idct_algo==FF_IDCT_MLIB){
+    if(s->avctx->idct_algo==FF_IDCT_MLIB){
         s->dsp.idct_put= ff_idct_put_mlib;
         s->dsp.idct_add= ff_idct_add_mlib;
         s->dsp.idct    = ff_idct_mlib;