diff options
author | Deb Mukherjee <debargha@google.com> | 2014-08-26 12:35:15 -0700 |
---|---|---|
committer | Deb Mukherjee <debargha@google.com> | 2014-09-02 14:37:10 -0700 |
commit | 5acfafb18e1720abfc0dc5baafce8e1a1b292b14 (patch) | |
tree | a89c5e2e79283e58a613b98dc3d7b3434ba6affe /vp9/decoder | |
parent | 72037944df611abccac02c225e20adc9479200db (diff) | |
download | libvpx-5acfafb18e1720abfc0dc5baafce8e1a1b292b14.tar libvpx-5acfafb18e1720abfc0dc5baafce8e1a1b292b14.tar.gz libvpx-5acfafb18e1720abfc0dc5baafce8e1a1b292b14.tar.bz2 libvpx-5acfafb18e1720abfc0dc5baafce8e1a1b292b14.zip |
Adds config opt for highbitdepth + misc. vpx
Adds config parameter vp9_highbitdepth, to support highbitdepth profiles.
Also includes most vpx level high bit-depth functions. However
encode/decode in the highbitdepth profiles will not work until
the rest of the code is in place.
Change-Id: I34c53b253c38873611057a6cbc89a1361b8985a6
Diffstat (limited to 'vp9/decoder')
-rw-r--r-- | vp9/decoder/vp9_decodeframe.c | 17 | ||||
-rw-r--r-- | vp9/decoder/vp9_decoder.c | 1 |
2 files changed, 14 insertions, 4 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c index aae56c178..372dc83c8 100644 --- a/vp9/decoder/vp9_decodeframe.c +++ b/vp9/decoder/vp9_decodeframe.c @@ -653,7 +653,11 @@ static void setup_frame_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { if (vp9_realloc_frame_buffer( get_frame_new_buffer(cm), cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, VP9_DEC_BORDER_IN_PIXELS, + cm->subsampling_x, cm->subsampling_y, +#if CONFIG_VP9_HIGHBITDEPTH + cm->use_highbitdepth, +#endif + VP9_DEC_BORDER_IN_PIXELS, &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer, cm->get_fb_cb, cm->cb_priv)) { vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, @@ -700,7 +704,11 @@ static void setup_frame_size_with_refs(VP9_COMMON *cm, if (vp9_realloc_frame_buffer( get_frame_new_buffer(cm), cm->width, cm->height, - cm->subsampling_x, cm->subsampling_y, VP9_DEC_BORDER_IN_PIXELS, + cm->subsampling_x, cm->subsampling_y, +#if CONFIG_VP9_HIGHBITDEPTH + cm->use_highbitdepth, +#endif + VP9_DEC_BORDER_IN_PIXELS, &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer, cm->get_fb_cb, cm->cb_priv)) { vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR, @@ -1100,7 +1108,7 @@ BITSTREAM_PROFILE vp9_read_profile(struct vp9_read_bit_buffer *rb) { static void read_bitdepth_colorspace_sampling( VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { if (cm->profile >= PROFILE_2) - cm->bit_depth = vp9_rb_read_bit(rb) ? BITS_12 : BITS_10; + cm->bit_depth = vp9_rb_read_bit(rb) ? VPX_BITS_12 : VPX_BITS_10; cm->color_space = (COLOR_SPACE)vp9_rb_read_literal(rb, 3); if (cm->color_space != SRGB) { vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range @@ -1144,6 +1152,7 @@ static size_t read_uncompressed_header(VP9Decoder *pbi, "Invalid frame marker"); cm->profile = vp9_read_profile(rb); + if (cm->profile >= MAX_PROFILES) vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, "Unsupported bitstream profile"); @@ -1402,7 +1411,7 @@ void vp9_decode_frame(VP9Decoder *pbi, if (!first_partition_size) { // showing a frame directly - *p_data_end = data + 1; + *p_data_end = data + (cm->profile <= PROFILE_2 ? 1 : 2); return; } diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c index ae0da796e..f461af53e 100644 --- a/vp9/decoder/vp9_decoder.c +++ b/vp9/decoder/vp9_decoder.c @@ -66,6 +66,7 @@ VP9Decoder *vp9_decoder_create() { cm->current_video_frame = 0; pbi->ready_for_new_data = 1; + cm->bit_depth = VPX_BITS_8; // vp9_init_dequantizer() is first called here. Add check in // frame_init_dequantizer() to avoid unnecessary calling of |