| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 {VP9_SEG_MAX, 0, 0, 0, NULL} | 39 {VP9_SEG_MAX, 0, 0, 0, NULL} |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 struct vpx_codec_alg_priv { | 42 struct vpx_codec_alg_priv { |
| 43 vpx_codec_priv_t base; | 43 vpx_codec_priv_t base; |
| 44 vpx_codec_mmap_t mmaps[NELEMENTS(vp9_mem_req_segs) - 1]; | 44 vpx_codec_mmap_t mmaps[NELEMENTS(vp9_mem_req_segs) - 1]; |
| 45 vpx_codec_dec_cfg_t cfg; | 45 vpx_codec_dec_cfg_t cfg; |
| 46 vp9_stream_info_t si; | 46 vp9_stream_info_t si; |
| 47 int defer_alloc; | 47 int defer_alloc; |
| 48 int decoder_init; | 48 int decoder_init; |
| 49 VP9D_PTR pbi; | 49 struct VP9Decompressor *pbi; |
| 50 int postproc_cfg_set; | 50 int postproc_cfg_set; |
| 51 vp8_postproc_cfg_t postproc_cfg; | 51 vp8_postproc_cfg_t postproc_cfg; |
| 52 #if CONFIG_POSTPROC_VISUALIZER | 52 #if CONFIG_POSTPROC_VISUALIZER |
| 53 unsigned int dbg_postproc_flag; | 53 unsigned int dbg_postproc_flag; |
| 54 int dbg_color_ref_frame_flag; | 54 int dbg_color_ref_frame_flag; |
| 55 int dbg_color_mb_modes_flag; | 55 int dbg_color_mb_modes_flag; |
| 56 int dbg_color_b_modes_flag; | 56 int dbg_color_b_modes_flag; |
| 57 int dbg_display_mv_flag; | 57 int dbg_display_mv_flag; |
| 58 #endif | 58 #endif |
| 59 vpx_image_t img; | 59 vpx_image_t img; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 si->w = si->h = 0; | 152 si->w = si->h = 0; |
| 153 | 153 |
| 154 { | 154 { |
| 155 struct vp9_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL }; | 155 struct vp9_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL }; |
| 156 const int frame_marker = vp9_rb_read_literal(&rb, 2); | 156 const int frame_marker = vp9_rb_read_literal(&rb, 2); |
| 157 const int version = vp9_rb_read_bit(&rb); | 157 const int version = vp9_rb_read_bit(&rb); |
| 158 (void) vp9_rb_read_bit(&rb); // unused version bit | 158 (void) vp9_rb_read_bit(&rb); // unused version bit |
| 159 | 159 |
| 160 if (frame_marker != VP9_FRAME_MARKER) | 160 if (frame_marker != VP9_FRAME_MARKER) |
| 161 return VPX_CODEC_UNSUP_BITSTREAM; | 161 return VPX_CODEC_UNSUP_BITSTREAM; |
| 162 #if CONFIG_NON420 | |
| 163 if (version > 1) return VPX_CODEC_UNSUP_BITSTREAM; | 162 if (version > 1) return VPX_CODEC_UNSUP_BITSTREAM; |
| 164 #else | |
| 165 if (version != 0) return VPX_CODEC_UNSUP_BITSTREAM; | |
| 166 #endif | |
| 167 | 163 |
| 168 if (vp9_rb_read_bit(&rb)) { // show an existing frame | 164 if (vp9_rb_read_bit(&rb)) { // show an existing frame |
| 169 return VPX_CODEC_OK; | 165 return VPX_CODEC_OK; |
| 170 } | 166 } |
| 171 | 167 |
| 172 si->is_kf = !vp9_rb_read_bit(&rb); | 168 si->is_kf = !vp9_rb_read_bit(&rb); |
| 173 if (si->is_kf) { | 169 if (si->is_kf) { |
| 174 const int sRGB = 7; | 170 const int sRGB = 7; |
| 175 int colorspace; | 171 int colorspace; |
| 176 | 172 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 267 } |
| 272 | 268 |
| 273 /* Initialize the decoder instance on the first frame*/ | 269 /* Initialize the decoder instance on the first frame*/ |
| 274 if (!res && !ctx->decoder_init) { | 270 if (!res && !ctx->decoder_init) { |
| 275 res = vpx_validate_mmaps(&ctx->si, ctx->mmaps, | 271 res = vpx_validate_mmaps(&ctx->si, ctx->mmaps, |
| 276 vp9_mem_req_segs, NELEMENTS(vp9_mem_req_segs), | 272 vp9_mem_req_segs, NELEMENTS(vp9_mem_req_segs), |
| 277 ctx->base.init_flags); | 273 ctx->base.init_flags); |
| 278 | 274 |
| 279 if (!res) { | 275 if (!res) { |
| 280 VP9D_CONFIG oxcf; | 276 VP9D_CONFIG oxcf; |
| 281 VP9D_PTR optr; | 277 struct VP9Decompressor *optr; |
| 282 | 278 |
| 283 vp9_initialize_dec(); | 279 vp9_initialize_dec(); |
| 284 | 280 |
| 285 oxcf.width = ctx->si.w; | 281 oxcf.width = ctx->si.w; |
| 286 oxcf.height = ctx->si.h; | 282 oxcf.height = ctx->si.h; |
| 287 oxcf.version = 9; | 283 oxcf.version = 9; |
| 288 oxcf.postprocess = 0; | 284 oxcf.postprocess = 0; |
| 289 oxcf.max_threads = ctx->cfg.threads; | 285 oxcf.max_threads = ctx->cfg.threads; |
| 290 oxcf.inv_tile_order = ctx->invert_tile_order; | 286 oxcf.inv_tile_order = ctx->invert_tile_order; |
| 291 optr = vp9_create_decompressor(&oxcf); | 287 optr = vp9_create_decompressor(&oxcf); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 assert(data_start <= data_end); | 451 assert(data_start <= data_end); |
| 456 | 452 |
| 457 /* Early exit if there was a decode error */ | 453 /* Early exit if there was a decode error */ |
| 458 if (res) | 454 if (res) |
| 459 break; | 455 break; |
| 460 | 456 |
| 461 /* Account for suboptimal termination by the encoder. */ | 457 /* Account for suboptimal termination by the encoder. */ |
| 462 while (data_start < data_end && *data_start == 0) | 458 while (data_start < data_end && *data_start == 0) |
| 463 data_start++; | 459 data_start++; |
| 464 | 460 |
| 465 data_sz = data_end - data_start; | 461 data_sz = (unsigned int)(data_end - data_start); |
| 466 } while (data_start < data_end); | 462 } while (data_start < data_end); |
| 467 return res; | 463 return res; |
| 468 } | 464 } |
| 469 | 465 |
| 470 static vpx_image_t *vp9_get_frame(vpx_codec_alg_priv_t *ctx, | 466 static vpx_image_t *vp9_get_frame(vpx_codec_alg_priv_t *ctx, |
| 471 vpx_codec_iter_t *iter) { | 467 vpx_codec_iter_t *iter) { |
| 472 vpx_image_t *img = NULL; | 468 vpx_image_t *img = NULL; |
| 473 | 469 |
| 474 if (ctx->img_avail) { | 470 if (ctx->img_avail) { |
| 475 /* iter acts as a flip flop, so an image is only returned on the first | 471 /* iter acts as a flip flop, so an image is only returned on the first |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 { // NOLINT | 750 { // NOLINT |
| 755 /* encoder functions */ | 751 /* encoder functions */ |
| 756 NOT_IMPLEMENTED, | 752 NOT_IMPLEMENTED, |
| 757 NOT_IMPLEMENTED, | 753 NOT_IMPLEMENTED, |
| 758 NOT_IMPLEMENTED, | 754 NOT_IMPLEMENTED, |
| 759 NOT_IMPLEMENTED, | 755 NOT_IMPLEMENTED, |
| 760 NOT_IMPLEMENTED, | 756 NOT_IMPLEMENTED, |
| 761 NOT_IMPLEMENTED | 757 NOT_IMPLEMENTED |
| 762 } | 758 } |
| 763 }; | 759 }; |
| OLD | NEW |