Merge commit '801c39e1e3058fc4ba822bfb5d8612d777111e32'
[ffmpeg.git] / libavcodec / arm / dsputil_init_neon.c
index 0450598..8da442b 100644 (file)
@@ -43,14 +43,14 @@ void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
                                int32_t max, unsigned int len);
 
 int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
+
 int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
                                              const int16_t *v3, int len, int mul);
 
-av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
+av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx,
+                                  unsigned high_bit_depth)
 {
-    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
-
-    if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
+    if (!avctx->lowres && !high_bit_depth) {
         if (avctx->idct_algo == FF_IDCT_AUTO ||
             avctx->idct_algo == FF_IDCT_SIMPLENEON) {
             c->idct_put              = ff_simple_idct_put_neon;
@@ -60,18 +60,19 @@ av_cold void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
         }
     }
 
+    c->add_pixels_clamped        = ff_add_pixels_clamped_neon;
+    c->put_pixels_clamped        = ff_put_pixels_clamped_neon;
+    c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
+
     if (!high_bit_depth) {
         c->clear_block  = ff_clear_block_neon;
         c->clear_blocks = ff_clear_blocks_neon;
     }
 
-    c->add_pixels_clamped = ff_add_pixels_clamped_neon;
-    c->put_pixels_clamped = ff_put_pixels_clamped_neon;
-    c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
-
-    c->vector_clipf               = ff_vector_clipf_neon;
-    c->vector_clip_int32          = ff_vector_clip_int32_neon;
+    c->vector_clipf      = ff_vector_clipf_neon;
+    c->vector_clip_int32 = ff_vector_clip_int32_neon;
 
     c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
+
     c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon;
 }