summaryrefslogtreecommitdiff
path: root/vp8/common
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/common')
-rw-r--r--vp8/common/alloccommon.c18
-rw-r--r--vp8/common/entropy.c6
-rw-r--r--vp8/common/entropy.h4
-rw-r--r--vp8/common/generic/systemdependent.c10
-rw-r--r--vp8/common/idctllm.c33
-rw-r--r--vp8/common/onyxc_int.h1
-rw-r--r--vp8/common/quant_common.c45
-rw-r--r--vp8/common/reconintra4x4.c16
8 files changed, 101 insertions, 32 deletions
diff --git a/vp8/common/alloccommon.c b/vp8/common/alloccommon.c
index 9dce8c8f6..5ab8e29ab 100644
--- a/vp8/common/alloccommon.c
+++ b/vp8/common/alloccommon.c
@@ -126,7 +126,16 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
}
void vp8_setup_version(VP8_COMMON *cm)
{
- switch (cm->version)
+ if (cm->version & 0x4)
+ {
+ if (!CONFIG_EXPERIMENTAL)
+ vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
+ "Bitstream was created by an experimental "
+ "encoder");
+ cm->experimental = 1;
+ }
+
+ switch (cm->version & 0x3)
{
case 0:
cm->no_lpf = 0;
@@ -152,13 +161,6 @@ void vp8_setup_version(VP8_COMMON *cm)
cm->use_bilinear_mc_filter = 1;
cm->full_pixel = 1;
break;
- default:
- /*4,5,6,7 are reserved for future use*/
- cm->no_lpf = 0;
- cm->simpler_lpf = 0;
- cm->use_bilinear_mc_filter = 0;
- cm->full_pixel = 0;
- break;
}
}
void vp8_create_common(VP8_COMMON *oci)
diff --git a/vp8/common/entropy.c b/vp8/common/entropy.c
index a1fe4f4ab..219483289 100644
--- a/vp8/common/entropy.c
+++ b/vp8/common/entropy.c
@@ -76,7 +76,7 @@ static const Prob Pcat3[] = { 173, 148, 140};
static const Prob Pcat4[] = { 176, 155, 140, 135};
static const Prob Pcat5[] = { 180, 157, 141, 134, 130};
static const Prob Pcat6[] =
-{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129};
+{ 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129};
static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22];
@@ -111,7 +111,7 @@ static void init_bit_trees()
init_bit_tree(cat3, 3);
init_bit_tree(cat4, 4);
init_bit_tree(cat5, 5);
- init_bit_tree(cat6, 11);
+ init_bit_tree(cat6, 13);
}
vp8_extra_bit_struct vp8_extra_bits[12] =
@@ -126,7 +126,7 @@ vp8_extra_bit_struct vp8_extra_bits[12] =
{ cat3, Pcat3, 3, 11},
{ cat4, Pcat4, 4, 19},
{ cat5, Pcat5, 5, 35},
- { cat6, Pcat6, 11, 67},
+ { cat6, Pcat6, 13, 67},
{ 0, 0, 0, 0}
};
#include "defaultcoefcounts.h"
diff --git a/vp8/common/entropy.h b/vp8/common/entropy.h
index d174e45b9..77f2673aa 100644
--- a/vp8/common/entropy.h
+++ b/vp8/common/entropy.h
@@ -27,7 +27,7 @@
#define DCT_VAL_CATEGORY3 7 /* 11-18 Extra Bits 3+1 */
#define DCT_VAL_CATEGORY4 8 /* 19-34 Extra Bits 4+1 */
#define DCT_VAL_CATEGORY5 9 /* 35-66 Extra Bits 5+1 */
-#define DCT_VAL_CATEGORY6 10 /* 67+ Extra Bits 11+1 */
+#define DCT_VAL_CATEGORY6 10 /* 67+ Extra Bits 13+1 */
#define DCT_EOB_TOKEN 11 /* EOB Extra Bits 0+0 */
#define vp8_coef_tokens 12
@@ -51,7 +51,7 @@ extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
#define PROB_UPDATE_BASELINE_COST 7
#define MAX_PROB 255
-#define DCT_MAX_VALUE 2048
+#define DCT_MAX_VALUE 8192
/* Coefficients are predicted via a 3-dimensional probability table. */
diff --git a/vp8/common/generic/systemdependent.c b/vp8/common/generic/systemdependent.c
index b3eadaf27..6ba0cfb87 100644
--- a/vp8/common/generic/systemdependent.c
+++ b/vp8/common/generic/systemdependent.c
@@ -83,8 +83,18 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
vp8_arch_x86_common_init(ctx);
#endif
+
#if ARCH_ARM
vp8_arch_arm_common_init(ctx);
#endif
+#if CONFIG_EXTEND_QRANGE
+ rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c;
+ rtcd->idct.idct16 = vp8_short_idct4x4llm_c;
+ rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c;
+ rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c;
+ rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c;
+
+#endif
+
}
diff --git a/vp8/common/idctllm.c b/vp8/common/idctllm.c
index 196062df6..c65d35adc 100644
--- a/vp8/common/idctllm.c
+++ b/vp8/common/idctllm.c
@@ -22,6 +22,8 @@
* so
* x * sqrt(2) * cos (pi/8) = x + x * (sqrt(2) *cos(pi/8)-1).
**************************************************************************/
+#include "vpx_ports/config.h"
+
static const int cospi8sqrt2minus1 = 20091;
static const int sinpi8sqrt2 = 35468;
static const int rounding = 0;
@@ -75,11 +77,19 @@ void vp8_short_idct4x4llm_c(short *input, short *output, int pitch)
d1 = temp1 + temp2;
+#if !CONFIG_EXTEND_QRANGE
op[0] = (a1 + d1 + 4) >> 3;
op[3] = (a1 - d1 + 4) >> 3;
op[1] = (b1 + c1 + 4) >> 3;
op[2] = (b1 - c1 + 4) >> 3;
+#else
+ op[0] = (a1 + d1 + 16) >> 5;
+ op[3] = (a1 - d1 + 16) >> 5;
+
+ op[1] = (b1 + c1 + 16) >> 5;
+ op[2] = (b1 - c1 + 16) >> 5;
+#endif
ip += shortpitch;
op += shortpitch;
@@ -92,8 +102,11 @@ void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch)
int a1;
short *op = output;
int shortpitch = pitch >> 1;
+#if !CONFIG_EXTEND_QRANGE
a1 = ((input[0] + 4) >> 3);
-
+#else
+ a1 = ((input[0] + 16) >> 5);
+#endif
for (i = 0; i < 4; i++)
{
op[0] = a1;
@@ -106,7 +119,11 @@ void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch)
void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride)
{
+#if !CONFIG_EXTEND_QRANGE
int a1 = ((input_dc + 4) >> 3);
+#else
+ int a1 = ((input_dc + 16) >> 5);
+#endif
int r, c;
for (r = 0; r < 4; r++)
@@ -168,11 +185,17 @@ void vp8_short_inv_walsh4x4_c(short *input, short *output)
c2 = a1 - b1;
d2 = d1 - c1;
+#if !CONFIG_EXTEND_QRANGE
op[0] = (a2 + 3) >> 3;
op[1] = (b2 + 3) >> 3;
op[2] = (c2 + 3) >> 3;
op[3] = (d2 + 3) >> 3;
-
+#else
+ op[0] = (a2 + 1) >> 2;
+ op[1] = (b2 + 1) >> 2;
+ op[2] = (c2 + 1) >> 2;
+ op[3] = (d2 + 1) >> 2;
+#endif
ip += 4;
op += 4;
}
@@ -184,7 +207,11 @@ void vp8_short_inv_walsh4x4_1_c(short *input, short *output)
int a1;
short *op = output;
- a1 = ((input[0] + 3) >> 3);
+#if !CONFIG_EXTEND_QRANGE
+ a1 = (input[0] + 3 )>> 3;
+#else
+ a1 = (input[0] + 1 )>> 2;
+#endif
for (i = 0; i < 4; i++)
{
diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h
index e011ec99a..90d63e535 100644
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -117,6 +117,7 @@ typedef struct VP8Common
int mode_info_stride;
/* profile settings */
+ int experimental;
int mb_no_coeff_skip;
int no_lpf;
int simpler_lpf;
diff --git a/vp8/common/quant_common.c b/vp8/common/quant_common.c
index e9833fe33..b8e6e2972 100644
--- a/vp8/common/quant_common.c
+++ b/vp8/common/quant_common.c
@@ -11,6 +11,8 @@
#include "quant_common.h"
+
+#if !CONFIG_EXTEND_QRANGE
static const int dc_qlookup[QINDEX_RANGE] =
{
4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17,
@@ -34,7 +36,32 @@ static const int ac_qlookup[QINDEX_RANGE] =
155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209,
213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284,
};
+#else
+
+static const int dc_qlookup[QINDEX_RANGE] =
+{
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 32, 34, 36, 38, 40, 42,
+ 44, 46, 49, 52, 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88,
+ 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152,
+ 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 205, 210, 215, 220,
+ 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300,
+ 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460,
+ 472, 484, 496, 508, 520, 532, 544, 556, 572, 588, 608, 628, 648, 668, 692, 720,
+};
+static const int ac_qlookup[QINDEX_RANGE] =
+{
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 51,
+ 54, 57, 60, 63, 66, 69, 72, 76, 80, 84, 88, 92, 96, 100, 105, 110,
+ 115, 120, 125, 130, 135, 140, 146, 152, 158, 164, 170, 176, 182, 188, 194, 200,
+ 206, 212, 218, 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 304, 312, 320,
+ 330, 340, 350, 360, 370, 380, 392, 404, 416, 428, 440, 454, 468, 482, 496, 510,
+ 524, 540, 556, 572, 588, 604, 622, 640, 658, 676, 696, 716, 736, 756, 776, 796,
+ 820, 844, 868, 892, 916, 944, 972, 1000, 1032, 1064, 1096, 1128, 1168, 1208, 1252, 1300
+};
+#endif
int vp8_dc_quant(int QIndex, int Delta)
{
@@ -62,7 +89,11 @@ int vp8_dc2quant(int QIndex, int Delta)
else if (QIndex < 0)
QIndex = 0;
+#if !CONFIG_EXTEND_QRANGE
retval = dc_qlookup[ QIndex ] * 2;
+#else
+ retval = dc_qlookup[ QIndex ];
+#endif
return retval;
}
@@ -72,16 +103,13 @@ int vp8_dc_uv_quant(int QIndex, int Delta)
QIndex = QIndex + Delta;
- if (QIndex > 127)
- QIndex = 127;
+ if (QIndex > 117)
+ QIndex = 117;
else if (QIndex < 0)
QIndex = 0;
retval = dc_qlookup[ QIndex ];
- if (retval > 132)
- retval = 132;
-
return retval;
}
@@ -108,12 +136,13 @@ int vp8_ac2quant(int QIndex, int Delta)
QIndex = 127;
else if (QIndex < 0)
QIndex = 0;
-
+#if !CONFIG_EXTEND_QRANGE
retval = (ac_qlookup[ QIndex ] * 155) / 100;
-
if (retval < 8)
retval = 8;
-
+#else
+ retval = ac_qlookup[ QIndex ];
+#endif
return retval;
}
int vp8_ac_uv_quant(int QIndex, int Delta)
diff --git a/vp8/common/reconintra4x4.c b/vp8/common/reconintra4x4.c
index db44fa190..d3d133836 100644
--- a/vp8/common/reconintra4x4.c
+++ b/vp8/common/reconintra4x4.c
@@ -81,10 +81,10 @@ void vp8_predict_intra4x4(BLOCKD *x,
{
unsigned int ap[4];
- ap[0] = (top_left + 2 * Above[0] + Above[1] + 2) >> 2;
- ap[1] = (Above[0] + 2 * Above[1] + Above[2] + 2) >> 2;
- ap[2] = (Above[1] + 2 * Above[2] + Above[3] + 2) >> 2;
- ap[3] = (Above[2] + 2 * Above[3] + Above[4] + 2) >> 2;
+ ap[0] = Above[0];
+ ap[1] = Above[1];
+ ap[2] = Above[2];
+ ap[3] = Above[3];
for (r = 0; r < 4; r++)
{
@@ -105,10 +105,10 @@ void vp8_predict_intra4x4(BLOCKD *x,
{
unsigned int lp[4];
- lp[0] = (top_left + 2 * Left[0] + Left[1] + 2) >> 2;
- lp[1] = (Left[0] + 2 * Left[1] + Left[2] + 2) >> 2;
- lp[2] = (Left[1] + 2 * Left[2] + Left[3] + 2) >> 2;
- lp[3] = (Left[2] + 2 * Left[3] + Left[3] + 2) >> 2;
+ lp[0] = Left[0];
+ lp[1] = Left[1];
+ lp[2] = Left[2];
+ lp[3] = Left[3];
for (r = 0; r < 4; r++)
{