[FFmpeg-soc] [soc]: r407 - in rv40: rv40.c rv40data.h

kostya subversion at mplayerhq.hu
Sat Jul 14 18:45:21 CEST 2007


Author: kostya
Date: Sat Jul 14 18:45:21 2007
New Revision: 407

Log:
Add dequantizing function for 16x16 DC values block

Modified:
   rv40/rv40.c
   rv40/rv40data.h

Modified: rv40/rv40.c
==============================================================================
--- rv40/rv40.c	(original)
+++ rv40/rv40.c	Sat Jul 14 18:45:21 2007
@@ -399,6 +399,21 @@ static inline void rv40_dequant4x4(DCTEL
             if(i || j)
                 block[j + i*8] = (block[j + i*8] * Q + 8) >> 4;
 }
+
+/**
+ * Dequantize 4x4 block of DC values for 16x16 macroblock
+ * @todo optimize
+ */
+static inline void rv40_dequant4x4_16x16(DCTELEM *block, int offset, int Qdc, int Q)
+{
+    int i;
+
+    block += offset;
+    for(i = 0; i < 3; i++)
+         block[rv40_dezigzag[i]] = (block[rv40_dezigzag[i]] * Qdc + 8) >> 4;
+    for(; i < 16; i++)
+         block[rv40_dezigzag[i]] = (block[rv40_dezigzag[i]] * Q + 8) >> 4;
+}
 /** @} */ //block functions
 
 

Modified: rv40/rv40data.h
==============================================================================
--- rv40/rv40data.h	(original)
+++ rv40/rv40data.h	Sat Jul 14 18:45:21 2007
@@ -137,4 +137,14 @@ static uint16_t rv40_qscale_tab[32] = {
  963, 1074, 1212, 1392, 1566, 1708, 1978, 2211
 };
 
+/**
+ * 4x4 dezigzag pattern
+ */
+static uint8_t rv40_dezigzag[16] = {
+  0,  1,  8, 16,
+  9,  2,  3, 10,
+ 17, 24, 25, 18,
+ 11, 19, 26, 27
+};
+
 #endif /* RV40DATA_H */



More information about the FFmpeg-soc mailing list