]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavs.c
dds: Fix enum declaration
[ffmpeg] / libavcodec / cavs.c
index 19b99294328e8a8d70a94aea06f343158d9fa355..fac695843c5d4541cf45735479dbbea619f0af50 100644 (file)
 #include "get_bits.h"
 #include "golomb.h"
 #include "h264chroma.h"
+#include "idctdsp.h"
+#include "internal.h"
 #include "mathops.h"
+#include "qpeldsp.h"
 #include "cavs.h"
 
 static const uint8_t alpha_tab[64] = {
@@ -87,9 +90,9 @@ static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b)
 }
 
 #define SET_PARAMS                                                \
-    alpha = alpha_tab[av_clip(qp_avg + h->alpha_offset, 0, 63)];  \
-    beta  =  beta_tab[av_clip(qp_avg + h->beta_offset,  0, 63)];  \
-    tc    =    tc_tab[av_clip(qp_avg + h->alpha_offset, 0, 63)];
+    alpha = alpha_tab[av_clip_uintp2(qp_avg + h->alpha_offset, 6)];  \
+    beta  =  beta_tab[av_clip_uintp2(qp_avg + h->beta_offset,  6)];  \
+    tc    =    tc_tab[av_clip_uintp2(qp_avg + h->alpha_offset, 6)];
 
 /**
  * in-loop deblocking filter for a single macroblock
@@ -275,7 +278,7 @@ static void intra_pred_plane(uint8_t *d, uint8_t *top, uint8_t *left, int stride
     int x, y, ia;
     int ih = 0;
     int iv = 0;
-    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
 
     for (x = 0; x < 4; x++) {
         ih += (x + 1) *  (top[5 + x] -  top[3 - x]);
@@ -408,7 +411,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
         full_mx + 16 /* FIXME */ > pic_width + extra_width ||
         full_my + 16 /* FIXME */ > pic_height + extra_height) {
         h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
-                                 src_y - 2 - 2 * h->l_stride, h->l_stride,
+                                 src_y - 2 - 2 * h->l_stride,
+                                 h->l_stride, h->l_stride,
                                  16 + 5, 16 + 5 /* FIXME */,
                                  full_mx - 2, full_my - 2,
                                  pic_width, pic_height);
@@ -421,7 +425,7 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
 
     if (emu) {
         h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
-                                 h->c_stride,
+                                 h->c_stride, h->c_stride,
                                  9, 9 /* FIXME */,
                                  mx >> 3, my >> 3,
                                  pic_width >> 1, pic_height >> 1);
@@ -431,7 +435,7 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
 
     if (emu) {
         h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
-                                 h->c_stride,
+                                 h->c_stride, h->c_stride,
                                  9, 9 /* FIXME */,
                                  mx >> 3, my >> 3,
                                  pic_width >> 1, pic_height >> 1);
@@ -526,8 +530,8 @@ static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,
 {
     int den = h->scale_den[src->ref];
 
-    *d_x = (src->x * distp * den + 256 + (src->x >> 31)) >> 9;
-    *d_y = (src->y * distp * den + 256 + (src->y >> 31)) >> 9;
+    *d_x = (src->x * distp * den + 256 + FF_SIGNBIT(src->x)) >> 9;
+    *d_y = (src->y * distp * den + 256 + FF_SIGNBIT(src->y)) >> 9;
 }
 
 static inline void mv_pred_median(AVSContext *h,
@@ -757,13 +761,14 @@ av_cold int ff_cavs_init(AVCodecContext *avctx)
 {
     AVSContext *h = avctx->priv_data;
 
-    ff_dsputil_init(&h->dsp, avctx);
+    ff_blockdsp_init(&h->bdsp, avctx);
     ff_h264chroma_init(&h->h264chroma, 8);
+    ff_idctdsp_init(&h->idsp, avctx);
     ff_videodsp_init(&h->vdsp, 8);
     ff_cavsdsp_init(&h->cdsp, avctx);
-    ff_init_scantable_permutation(h->dsp.idct_permutation,
+    ff_init_scantable_permutation(h->idsp.idct_permutation,
                                   h->cdsp.idct_perm);
-    ff_init_scantable(h->dsp.idct_permutation, &h->scantable, ff_zigzag_direct);
+    ff_init_scantable(h->idsp.idct_permutation, &h->scantable, ff_zigzag_direct);
 
     h->avctx       = avctx;
     avctx->pix_fmt = AV_PIX_FMT_YUV420P;