Home | History | Annotate | Download | only in common
      1 /*
      2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #include "vpx_config.h"
     12 #include "vpx_rtcd.h"
     13 
     14 void vp8_dequant_idct_add_c(short *input, short *dq,
     15                             unsigned char *dest, int stride);
     16 void vp8_dc_only_idct_add_c(short input_dc, unsigned char * pred,
     17                             int pred_stride, unsigned char *dst_ptr,
     18                             int dst_stride);
     19 
     20 void vp8_dequant_idct_add_y_block_c
     21             (short *q, short *dq,
     22              unsigned char *dst, int stride, char *eobs)
     23 {
     24     int i, j;
     25 
     26     for (i = 0; i < 4; i++)
     27     {
     28         for (j = 0; j < 4; j++)
     29         {
     30             if (*eobs++ > 1)
     31                 vp8_dequant_idct_add_c (q, dq, dst, stride);
     32             else
     33             {
     34                 vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride);
     35                 ((int *)q)[0] = 0;
     36             }
     37 
     38             q   += 16;
     39             dst += 4;
     40         }
     41 
     42         dst += 4*stride - 16;
     43     }
     44 }
     45 
     46 void vp8_dequant_idct_add_uv_block_c
     47             (short *q, short *dq,
     48              unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
     49 {
     50     int i, j;
     51 
     52     for (i = 0; i < 2; i++)
     53     {
     54         for (j = 0; j < 2; j++)
     55         {
     56             if (*eobs++ > 1)
     57                 vp8_dequant_idct_add_c (q, dq, dstu, stride);
     58             else
     59             {
     60                 vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride);
     61                 ((int *)q)[0] = 0;
     62             }
     63 
     64             q    += 16;
     65             dstu += 4;
     66         }
     67 
     68         dstu += 4*stride - 8;
     69     }
     70 
     71     for (i = 0; i < 2; i++)
     72     {
     73         for (j = 0; j < 2; j++)
     74         {
     75             if (*eobs++ > 1)
     76                 vp8_dequant_idct_add_c (q, dq, dstv, stride);
     77             else
     78             {
     79                 vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride);
     80                 ((int *)q)[0] = 0;
     81             }
     82 
     83             q    += 16;
     84             dstv += 4;
     85         }
     86 
     87         dstv += 4*stride - 8;
     88     }
     89 }
     90