Reinitialize dequantizer when switching from 10/12 bit to 8 bit.
Change-Id: Id294cf8d314a3f8aaf4ca2a6b3da052cc898a78c
This commit is contained in:
@@ -185,6 +185,7 @@ typedef struct VP9Common {
|
||||
|
||||
// VPX_BITS_8 in versions 0 and 1, VPX_BITS_10/VPX_BITS_12 in version 2
|
||||
vpx_bit_depth_t bit_depth;
|
||||
vpx_bit_depth_t dequant_bit_depth;
|
||||
|
||||
#if CONFIG_VP9_POSTPROC
|
||||
struct postproc_state postproc_state;
|
||||
|
||||
@@ -646,10 +646,10 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||
update |= read_delta_q(rb, &cm->uv_dc_delta_q);
|
||||
update |= read_delta_q(rb, &cm->uv_ac_delta_q);
|
||||
|
||||
// TODO(peter.derivaz): Don't really want to call this for every frame
|
||||
// for high-bit-depth, but need the bit depth to init dequantizers
|
||||
if (update || cm->profile >= PROFILE_2)
|
||||
if (update || cm->bit_depth != cm->dequant_bit_depth) {
|
||||
vp9_init_dequantizer(cm);
|
||||
cm->dequant_bit_depth = cm->bit_depth;
|
||||
}
|
||||
|
||||
xd->lossless = cm->base_qindex == 0 &&
|
||||
cm->y_dc_delta_q == 0 &&
|
||||
|
||||
@@ -66,6 +66,7 @@ VP9Decoder *vp9_decoder_create() {
|
||||
vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));
|
||||
|
||||
cm->current_video_frame = 0;
|
||||
cm->dequant_bit_depth = VPX_BITS_NOT_SET;
|
||||
pbi->ready_for_new_data = 1;
|
||||
|
||||
// vp9_init_dequantizer() is first called here. Add check in
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "./vpx_config.h"
|
||||
#include "./vpx_integer.h"
|
||||
#include "./vpx_image.h"
|
||||
@@ -218,7 +220,8 @@ extern "C" {
|
||||
typedef enum vpx_bit_depth {
|
||||
VPX_BITS_8 = 8, /**< 8 bits */
|
||||
VPX_BITS_10 = 10, /**< 10 bits */
|
||||
VPX_BITS_12 = 12 /**< 12 bits */
|
||||
VPX_BITS_12 = 12, /**< 12 bits */
|
||||
VPX_BITS_NOT_SET = 0xFF /**< Invalid value */
|
||||
} vpx_bit_depth_t;
|
||||
|
||||
/*
|
||||
@@ -481,6 +484,9 @@ static INLINE unsigned int vpx_bit_depth_to_bps(vpx_bit_depth_t bit_depth) {
|
||||
case VPX_BITS_12:
|
||||
bps = 12;
|
||||
break;
|
||||
case VPX_BITS_NOT_SET:
|
||||
assert(0 && "Bit depth is not initialized.");
|
||||
break;
|
||||
}
|
||||
return bps;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user