summaryrefslogtreecommitdiff
path: root/vp8/common/quant_common.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-07-13 15:21:29 -0700
committerJohn Koleszar <jkoleszar@google.com>2012-07-17 11:46:03 -0700
commitc6b9039fd94aede59ac1086a379955137fc8e1b8 (patch)
treef9b20b2ca2114fe9303c8226bb3b368568fd5509 /vp8/common/quant_common.c
parent8697c6e454e02c6cf644daa9d29fabd07e846f18 (diff)
downloadlibvpx-c6b9039fd94aede59ac1086a379955137fc8e1b8.tar
libvpx-c6b9039fd94aede59ac1086a379955137fc8e1b8.tar.gz
libvpx-c6b9039fd94aede59ac1086a379955137fc8e1b8.tar.bz2
libvpx-c6b9039fd94aede59ac1086a379955137fc8e1b8.zip
Restyle code
Approximate the Google style guide[1] so that that there's a written document to follow and tools to check compliance[2]. [1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml [2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
Diffstat (limited to 'vp8/common/quant_common.c')
-rw-r--r--vp8/common/quant_common.c158
1 files changed, 75 insertions, 83 deletions
diff --git a/vp8/common/quant_common.c b/vp8/common/quant_common.c
index 0bb44f588..65453d88c 100644
--- a/vp8/common/quant_common.c
+++ b/vp8/common/quant_common.c
@@ -16,118 +16,110 @@ static int ac_qlookup[QINDEX_RANGE];
#define ACDC_MIN 4
-void vp8_init_quant_tables()
-{
- int i;
- int current_val = 4;
- int last_val = 4;
- int ac_val;
-
- for ( i = 0; i < QINDEX_RANGE; i++ )
- {
- ac_qlookup[i] = current_val;
- current_val = (int)((double)current_val * 1.02);
- if ( current_val == last_val )
- current_val++;
- last_val = current_val;
-
- ac_val = ac_qlookup[i];
- dc_qlookup[i] = (0.000000305 * ac_val * ac_val * ac_val) +
- (-0.00065 * ac_val * ac_val) +
- (0.9 * ac_val) + 0.5;
- if ( dc_qlookup[i] < ACDC_MIN )
- dc_qlookup[i] = ACDC_MIN;
- }
+void vp8_init_quant_tables() {
+ int i;
+ int current_val = 4;
+ int last_val = 4;
+ int ac_val;
+
+ for (i = 0; i < QINDEX_RANGE; i++) {
+ ac_qlookup[i] = current_val;
+ current_val = (int)((double)current_val * 1.02);
+ if (current_val == last_val)
+ current_val++;
+ last_val = current_val;
+
+ ac_val = ac_qlookup[i];
+ dc_qlookup[i] = (0.000000305 * ac_val * ac_val * ac_val) +
+ (-0.00065 * ac_val * ac_val) +
+ (0.9 * ac_val) + 0.5;
+ if (dc_qlookup[i] < ACDC_MIN)
+ dc_qlookup[i] = ACDC_MIN;
+ }
}
-int vp8_dc_quant(int QIndex, int Delta)
-{
- int retval;
+int vp8_dc_quant(int QIndex, int Delta) {
+ int retval;
- QIndex = QIndex + Delta;
+ QIndex = QIndex + Delta;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = dc_qlookup[ QIndex ];
- return retval;
+ retval = dc_qlookup[ QIndex ];
+ return retval;
}
-int vp8_dc2quant(int QIndex, int Delta)
-{
- int retval;
+int vp8_dc2quant(int QIndex, int Delta) {
+ int retval;
- QIndex = QIndex + Delta;
+ QIndex = QIndex + Delta;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = dc_qlookup[ QIndex ];
+ retval = dc_qlookup[ QIndex ];
- return retval;
+ return retval;
}
-int vp8_dc_uv_quant(int QIndex, int Delta)
-{
- int retval;
+int vp8_dc_uv_quant(int QIndex, int Delta) {
+ int retval;
- QIndex = QIndex + Delta;
+ QIndex = QIndex + Delta;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = dc_qlookup[ QIndex ];
+ retval = dc_qlookup[ QIndex ];
- return retval;
+ return retval;
}
-int vp8_ac_yquant(int QIndex)
-{
- int retval;
+int vp8_ac_yquant(int QIndex) {
+ int retval;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = ac_qlookup[ QIndex ];
- return retval;
+ retval = ac_qlookup[ QIndex ];
+ return retval;
}
-int vp8_ac2quant(int QIndex, int Delta)
-{
- int retval;
+int vp8_ac2quant(int QIndex, int Delta) {
+ int retval;
- QIndex = QIndex + Delta;
+ QIndex = QIndex + Delta;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = (ac_qlookup[ QIndex ] * 775) / 1000;
- if (retval < 4)
- retval = 4;
+ retval = (ac_qlookup[ QIndex ] * 775) / 1000;
+ if (retval < 4)
+ retval = 4;
- return retval;
+ return retval;
}
-int vp8_ac_uv_quant(int QIndex, int Delta)
-{
- int retval;
+int vp8_ac_uv_quant(int QIndex, int Delta) {
+ int retval;
- QIndex = QIndex + Delta;
+ QIndex = QIndex + Delta;
- if (QIndex > MAXQ)
- QIndex = MAXQ;
- else if (QIndex < 0)
- QIndex = 0;
+ if (QIndex > MAXQ)
+ QIndex = MAXQ;
+ else if (QIndex < 0)
+ QIndex = 0;
- retval = ac_qlookup[ QIndex ];
- return retval;
+ retval = ac_qlookup[ QIndex ];
+ return retval;
}