]> granicus.if.org Git - libvpx/commitdiff
Adding fht{4x4, 8x8, 16x16} functions.
authorDmitry Kovalev <dkovalev@google.com>
Sat, 26 Oct 2013 00:55:07 +0000 (17:55 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Sat, 26 Oct 2013 00:55:07 +0000 (17:55 -0700)
Adding these functions to encapsulate tx_type check. Changing TX_TYPE to
int to match the declaration in vo9_rtch.h.

Change-Id: I6f3a2df6e35595ca73b6aaa9e3909ee7bc3fd16f

vp9/encoder/vp9_dct.c
vp9/encoder/vp9_dct.h [new file with mode: 0644]
vp9/encoder/vp9_encodemb.c
vp9/vp9cx.mk

index 0a0afedfdfe01bdcaaf9e21dd9218c55450bfafe..065992a257a58d0bb32cd833cedc90b6ce3f0bb7 100644 (file)
@@ -8,14 +8,17 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-
 #include <assert.h>
 #include <math.h>
+
 #include "./vpx_config.h"
-#include "vp9/common/vp9_systemdependent.h"
+#include "./vp9_rtcd.h"
 
 #include "vp9/common/vp9_blockd.h"
 #include "vp9/common/vp9_idct.h"
+#include "vp9/common/vp9_systemdependent.h"
+
+#include "vp9/encoder/vp9_dct.h"
 
 static void fdct4(const int16_t *input, int16_t *output) {
   int16_t step[4];
@@ -149,7 +152,7 @@ static const transform_2d FHT_4[] = {
 };
 
 void vp9_short_fht4x4_c(const int16_t *input, int16_t *output,
-                        int stride, TX_TYPE tx_type) {
+                        int stride, int tx_type) {
   int16_t out[4 * 4];
   int16_t *outptr = &out[0];
   int i, j;
@@ -557,7 +560,7 @@ static const transform_2d FHT_8[] = {
 };
 
 void vp9_short_fht8x8_c(const int16_t *input, int16_t *output,
-                        int stride, TX_TYPE tx_type) {
+                        int stride, int tx_type) {
   int16_t out[64];
   int16_t *outptr = &out[0];
   int i, j;
@@ -950,7 +953,7 @@ static const transform_2d FHT_16[] = {
 };
 
 void vp9_short_fht16x16_c(const int16_t *input, int16_t *output,
-                          int stride, TX_TYPE tx_type) {
+                          int stride, int tx_type) {
   int16_t out[256];
   int16_t *outptr = &out[0];
   int i, j;
@@ -1366,3 +1369,27 @@ void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) {
       out[j + i * 32] = temp_out[j];
   }
 }
+
+void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                int stride) {
+  if (tx_type == DCT_DCT)
+    vp9_fdct4x4(input, output, stride);
+  else
+    vp9_short_fht4x4(input, output, stride, tx_type);
+}
+
+void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                int stride) {
+  if (tx_type == DCT_DCT)
+    vp9_fdct8x8(input, output, stride);
+  else
+    vp9_short_fht8x8(input, output, stride, tx_type);
+}
+
+void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                  int stride) {
+  if (tx_type == DCT_DCT)
+    vp9_fdct16x16(input, output, stride);
+  else
+    vp9_short_fht16x16(input, output, stride, tx_type);
+}
diff --git a/vp9/encoder/vp9_dct.h b/vp9/encoder/vp9_dct.h
new file mode 100644 (file)
index 0000000..aaf976d
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+#ifndef VP9_ENCODER_VP9_DCT_H_
+#define VP9_ENCODER_VP9_DCT_H_
+
+void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                int stride);
+
+void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                int stride);
+
+void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
+                  int stride);
+
+#endif  // VP9_ENCODER_VP9_DCT_H_
index f335df566403b1becd16210a5a6c41a51a29e7d9..91546e8cf0f3c24f78c65e116b11b56adac556ba 100644 (file)
@@ -19,6 +19,7 @@
 #include "vp9/common/vp9_reconintra.h"
 #include "vp9/common/vp9_systemdependent.h"
 
+#include "vp9/encoder/vp9_dct.h"
 #include "vp9/encoder/vp9_encodemb.h"
 #include "vp9/encoder/vp9_quantize.h"
 #include "vp9/encoder/vp9_rdopt.h"
@@ -577,10 +578,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                               dst, pd->dst.stride, dst, pd->dst.stride);
       vp9_subtract_block(16, 16, src_diff, bw * 4,
                          src, p->src.stride, dst, pd->dst.stride);
-      if (tx_type != DCT_DCT)
-        vp9_short_fht16x16(src_diff, coeff, bw * 4, tx_type);
-      else
-        vp9_fdct16x16(src_diff, coeff, bw * 4);
+      vp9_fht16x16(tx_type, src_diff, coeff, bw * 4);
       vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round,
                      p->quant, p->quant_shift, qcoeff, dqcoeff,
                      pd->dequant, p->zbin_extra, eob, scan, iscan);
@@ -602,10 +600,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                               dst, pd->dst.stride, dst, pd->dst.stride);
       vp9_subtract_block(8, 8, src_diff, bw * 4,
                          src, p->src.stride, dst, pd->dst.stride);
-      if (tx_type != DCT_DCT)
-        vp9_short_fht8x8(src_diff, coeff, bw * 4, tx_type);
-      else
-        vp9_fdct8x8(src_diff, coeff, bw * 4);
+      vp9_fht8x8(tx_type, src_diff, coeff, bw * 4);
       vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant,
                      p->quant_shift, qcoeff, dqcoeff,
                      pd->dequant, p->zbin_extra, eob, scan, iscan);
index b454eee02996e2e4dc61fdcc7083b0c1eed219be..0993c6ce64f6a6e812ca9a869a9b326d1b2107ae 100644 (file)
@@ -20,6 +20,7 @@ VP9_CX_SRCS-yes += vp9_cx_iface.c
 VP9_CX_SRCS-yes += encoder/vp9_bitstream.c
 VP9_CX_SRCS-yes += encoder/vp9_boolhuff.c
 VP9_CX_SRCS-yes += encoder/vp9_dct.c
+VP9_CX_SRCS-yes += encoder/vp9_dct.h
 VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c
 VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h
 VP9_CX_SRCS-yes += encoder/vp9_encodeintra.c