2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
14 #include "./vp8_rtcd.h"
15 #include "./vpx_dsp_rtcd.h"
16 #include "./vpx_scale_rtcd.h"
17 #include "vpx/vpx_decoder.h"
18 #include "vpx/vp8dx.h"
19 #include "vpx/internal/vpx_codec_internal.h"
20 #include "vpx_version.h"
21 #include "common/alloccommon.h"
22 #include "common/common.h"
23 #include "common/onyxd.h"
24 #include "decoder/onyxd_int.h"
25 #include "vpx_mem/vpx_mem.h"
26 #if CONFIG_ERROR_CONCEALMENT
27 #include "decoder/error_concealment.h"
29 #include "decoder/decoderthreading.h"
31 #define VP8_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0)
32 #define VP8_CAP_ERROR_CONCEALMENT (CONFIG_ERROR_CONCEALMENT ? \
33 VPX_CODEC_CAP_ERROR_CONCEALMENT : 0)
35 typedef vpx_codec_stream_info_t vp8_stream_info_t;
37 /* Structures for handling memory allocations */
40 VP8_SEG_ALG_PRIV = 256,
43 #define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0])))
45 struct vpx_codec_alg_priv
47 vpx_codec_priv_t base;
48 vpx_codec_dec_cfg_t cfg;
52 vp8_postproc_cfg_t postproc_cfg;
53 #if CONFIG_POSTPROC_VISUALIZER
54 unsigned int dbg_postproc_flag;
55 int dbg_color_ref_frame_flag;
56 int dbg_color_mb_modes_flag;
57 int dbg_color_b_modes_flag;
58 int dbg_display_mv_flag;
60 vpx_decrypt_cb decrypt_cb;
64 struct frame_buffers yv12_frame_buffers;
66 FRAGMENT_DATA fragments;
69 static void vp8_init_ctx(vpx_codec_ctx_t *ctx)
71 vpx_codec_alg_priv_t *priv =
72 (vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv));
74 ctx->priv = (vpx_codec_priv_t *)priv;
75 ctx->priv->init_flags = ctx->init_flags;
77 priv->si.sz = sizeof(priv->si);
78 priv->decrypt_cb = NULL;
79 priv->decrypt_state = NULL;
83 /* Update the reference to the config structure to an internal copy. */
84 priv->cfg = *ctx->config.dec;
85 ctx->config.dec = &priv->cfg;
89 static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
90 vpx_codec_priv_enc_mr_cfg_t *data)
92 vpx_codec_err_t res = VPX_CODEC_OK;
93 vpx_codec_alg_priv_t *priv = NULL;
100 /* This function only allocates space for the vpx_codec_alg_priv_t
101 * structure. More memory may be required at the time the stream
102 * information becomes known.
106 priv = (vpx_codec_alg_priv_t *)ctx->priv;
108 /* initialize number of fragments to zero */
109 priv->fragments.count = 0;
110 /* is input fragments enabled? */
111 priv->fragments.enabled =
112 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
114 /*post processing level initialized to do nothing */
116 priv = (vpx_codec_alg_priv_t *)ctx->priv;
119 priv->yv12_frame_buffers.use_frame_threads =
120 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING);
122 /* for now, disable frame threading */
123 priv->yv12_frame_buffers.use_frame_threads = 0;
125 if (priv->yv12_frame_buffers.use_frame_threads &&
126 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
127 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
128 /* row-based threading, error concealment, and input fragments will
129 * not be supported when using frame-based threading */
130 res = VPX_CODEC_INVALID_PARAM;
136 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx)
138 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers);
145 static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
146 unsigned int data_sz,
147 vpx_codec_stream_info_t *si,
148 vpx_decrypt_cb decrypt_cb,
151 vpx_codec_err_t res = VPX_CODEC_OK;
153 if(data + data_sz <= data)
155 res = VPX_CODEC_INVALID_PARAM;
159 /* Parse uncompresssed part of key frame header.
160 * 3 bytes:- including version, frame type and an offset
161 * 3 bytes:- sync code (0x9d, 0x01, 0x2a)
162 * 4 bytes:- including image width and height in the lowest 14 bits
163 * of each 2-byte value.
165 uint8_t clear_buffer[10];
166 const uint8_t *clear = data;
169 int n = VPXMIN(sizeof(clear_buffer), data_sz);
170 decrypt_cb(decrypt_state, data, clear_buffer, n);
171 clear = clear_buffer;
175 if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
179 /* vet via sync code */
180 if (clear[3] != 0x9d || clear[4] != 0x01 || clear[5] != 0x2a)
181 return VPX_CODEC_UNSUP_BITSTREAM;
183 si->w = (clear[6] | (clear[7] << 8)) & 0x3fff;
184 si->h = (clear[8] | (clear[9] << 8)) & 0x3fff;
186 /*printf("w=%d, h=%d\n", si->w, si->h);*/
187 if (!(si->h | si->w))
188 res = VPX_CODEC_UNSUP_BITSTREAM;
192 res = VPX_CODEC_UNSUP_BITSTREAM;
199 static vpx_codec_err_t vp8_peek_si(const uint8_t *data,
200 unsigned int data_sz,
201 vpx_codec_stream_info_t *si) {
202 return vp8_peek_si_internal(data, data_sz, si, NULL, NULL);
205 static vpx_codec_err_t vp8_get_si(vpx_codec_alg_priv_t *ctx,
206 vpx_codec_stream_info_t *si)
211 if (si->sz >= sizeof(vp8_stream_info_t))
212 sz = sizeof(vp8_stream_info_t);
214 sz = sizeof(vpx_codec_stream_info_t);
216 memcpy(si, &ctx->si, sz);
223 static vpx_codec_err_t
224 update_error_state(vpx_codec_alg_priv_t *ctx,
225 const struct vpx_internal_error_info *error)
229 if ((res = error->error_code))
230 ctx->base.err_detail = error->has_detail
237 static void yuvconfig2image(vpx_image_t *img,
238 const YV12_BUFFER_CONFIG *yv12,
241 /** vpx_img_wrap() doesn't allow specifying independent strides for
242 * the Y, U, and V planes, nor other alignment adjustments that
243 * might be representable by a YV12_BUFFER_CONFIG, so we just
244 * initialize all the fields.*/
245 img->fmt = VPX_IMG_FMT_I420;
246 img->w = yv12->y_stride;
247 img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
248 img->d_w = yv12->y_width;
249 img->d_h = yv12->y_height;
250 img->x_chroma_shift = 1;
251 img->y_chroma_shift = 1;
252 img->planes[VPX_PLANE_Y] = yv12->y_buffer;
253 img->planes[VPX_PLANE_U] = yv12->u_buffer;
254 img->planes[VPX_PLANE_V] = yv12->v_buffer;
255 img->planes[VPX_PLANE_ALPHA] = NULL;
256 img->stride[VPX_PLANE_Y] = yv12->y_stride;
257 img->stride[VPX_PLANE_U] = yv12->uv_stride;
258 img->stride[VPX_PLANE_V] = yv12->uv_stride;
259 img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
262 img->user_priv = user_priv;
263 img->img_data = yv12->buffer_alloc;
264 img->img_data_owner = 0;
265 img->self_allocd = 0;
269 update_fragments(vpx_codec_alg_priv_t *ctx,
271 unsigned int data_sz,
272 vpx_codec_err_t *res)
276 if (ctx->fragments.count == 0)
278 /* New frame, reset fragment pointers and sizes */
279 memset((void*)ctx->fragments.ptrs, 0, sizeof(ctx->fragments.ptrs));
280 memset(ctx->fragments.sizes, 0, sizeof(ctx->fragments.sizes));
282 if (ctx->fragments.enabled && !(data == NULL && data_sz == 0))
284 /* Store a pointer to this fragment and return. We haven't
285 * received the complete frame yet, so we will wait with decoding.
287 ctx->fragments.ptrs[ctx->fragments.count] = data;
288 ctx->fragments.sizes[ctx->fragments.count] = data_sz;
289 ctx->fragments.count++;
290 if (ctx->fragments.count > (1 << EIGHT_PARTITION) + 1)
292 ctx->fragments.count = 0;
293 *res = VPX_CODEC_INVALID_PARAM;
299 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
304 if (!ctx->fragments.enabled)
306 ctx->fragments.ptrs[0] = data;
307 ctx->fragments.sizes[0] = data_sz;
308 ctx->fragments.count = 1;
314 static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
316 unsigned int data_sz,
320 vpx_codec_err_t res = VPX_CODEC_OK;
321 unsigned int resolution_change = 0;
324 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
329 /* Update the input fragment data */
330 if(update_fragments(ctx, data, data_sz, &res) <= 0)
333 /* Determine the stream parameters. Note that we rely on peek_si to
334 * validate that we have a buffer that does not wrap around the top
340 res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
341 &ctx->si, ctx->decrypt_cb, ctx->decrypt_state);
343 if((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf)
345 /* the peek function returns an error for non keyframes, however for
346 * this case, it is not an error */
350 if(!ctx->decoder_init && !ctx->si.is_kf)
351 res = VPX_CODEC_UNSUP_BITSTREAM;
353 if ((ctx->si.h != h) || (ctx->si.w != w))
354 resolution_change = 1;
356 /* Initialize the decoder instance on the first frame*/
357 if (!res && !ctx->decoder_init)
361 oxcf.Width = ctx->si.w;
362 oxcf.Height = ctx->si.h;
364 oxcf.postprocess = 0;
365 oxcf.max_threads = ctx->cfg.threads;
366 oxcf.error_concealment =
367 (ctx->base.init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT);
369 /* If postprocessing was enabled by the application and a
370 * configuration has not been provided, default it.
372 if (!ctx->postproc_cfg_set
373 && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
374 ctx->postproc_cfg.post_proc_flag =
375 VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE;
376 ctx->postproc_cfg.deblocking_level = 4;
377 ctx->postproc_cfg.noise_level = 0;
380 res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf);
381 ctx->decoder_init = 1;
384 /* Set these even if already initialized. The caller may have changed the
385 * decrypt config between frames.
387 if (ctx->decoder_init) {
388 ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
389 ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
394 VP8D_COMP *pbi = ctx->yv12_frame_buffers.pbi[0];
395 if (resolution_change)
397 VP8_COMMON *const pc = & pbi->common;
398 MACROBLOCKD *const xd = & pbi->mb;
399 #if CONFIG_MULTITHREAD
402 pc->Width = ctx->si.w;
403 pc->Height = ctx->si.h;
405 int prev_mb_rows = pc->mb_rows;
407 if (setjmp(pbi->common.error.jmp))
409 pbi->common.error.setjmp = 0;
410 vp8_clear_system_state();
411 /* same return value as used in vp8dx_receive_compressed_data */
415 pbi->common.error.setjmp = 1;
420 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
421 "Invalid frame width");
427 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
428 "Invalid frame height");
431 if (vp8_alloc_frame_buffers(pc, pc->Width, pc->Height))
432 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
433 "Failed to allocate frame buffers");
435 xd->pre = pc->yv12_fb[pc->lst_fb_idx];
436 xd->dst = pc->yv12_fb[pc->new_fb_idx];
438 #if CONFIG_MULTITHREAD
439 for (i = 0; i < pbi->allocated_decoding_thread_count; i++)
441 pbi->mb_row_di[i].mbd.dst = pc->yv12_fb[pc->new_fb_idx];
442 vp8_build_block_doffsets(&pbi->mb_row_di[i].mbd);
445 vp8_build_block_doffsets(&pbi->mb);
447 /* allocate memory for last frame MODE_INFO array */
448 #if CONFIG_ERROR_CONCEALMENT
452 /* old prev_mip was released by vp8_de_alloc_frame_buffers()
453 * called in vp8_alloc_frame_buffers() */
454 pc->prev_mip = vpx_calloc(
455 (pc->mb_cols + 1) * (pc->mb_rows + 1),
460 vp8_de_alloc_frame_buffers(pc);
461 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
463 "last frame MODE_INFO array");
466 pc->prev_mi = pc->prev_mip + pc->mode_info_stride + 1;
468 if (vp8_alloc_overlap_lists(pbi))
469 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
470 "Failed to allocate overlap lists "
471 "for error concealment");
476 #if CONFIG_MULTITHREAD
477 if (pbi->b_multithreaded_rd)
478 vp8mt_alloc_temp_buffers(pbi, pc->Width, prev_mb_rows);
484 pbi->common.error.setjmp = 0;
486 /* required to get past the first get_free_fb() call */
487 pbi->common.fb_idx_ref_cnt[0] = 0;
490 /* update the pbi fragment data */
491 pbi->fragments = ctx->fragments;
493 ctx->user_priv = user_priv;
494 if (vp8dx_receive_compressed_data(pbi, data_sz, data, deadline))
496 res = update_error_state(ctx, &pbi->common.error);
499 /* get ready for the next series of fragments */
500 ctx->fragments.count = 0;
506 static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
507 vpx_codec_iter_t *iter)
509 vpx_image_t *img = NULL;
511 /* iter acts as a flip flop, so an image is only returned on the first
514 if (!(*iter) && ctx->yv12_frame_buffers.pbi[0])
516 YV12_BUFFER_CONFIG sd;
517 int64_t time_stamp = 0, time_end_stamp = 0;
518 vp8_ppflags_t flags = {0};
520 if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
522 flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
523 #if CONFIG_POSTPROC_VISUALIZER
525 | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
526 | ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
527 | ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
528 | ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
531 flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
532 flags.noise_level = ctx->postproc_cfg.noise_level;
533 #if CONFIG_POSTPROC_VISUALIZER
534 flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
535 flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
536 flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
537 flags.display_mv_flag = ctx->dbg_display_mv_flag;
541 if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
542 &time_stamp, &time_end_stamp, &flags))
544 yuvconfig2image(&ctx->img, &sd, ctx->user_priv);
554 static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
555 YV12_BUFFER_CONFIG *yv12)
557 const int y_w = img->d_w;
558 const int y_h = img->d_h;
559 const int uv_w = (img->d_w + 1) / 2;
560 const int uv_h = (img->d_h + 1) / 2;
561 vpx_codec_err_t res = VPX_CODEC_OK;
562 yv12->y_buffer = img->planes[VPX_PLANE_Y];
563 yv12->u_buffer = img->planes[VPX_PLANE_U];
564 yv12->v_buffer = img->planes[VPX_PLANE_V];
566 yv12->y_crop_width = y_w;
567 yv12->y_crop_height = y_h;
569 yv12->y_height = y_h;
570 yv12->uv_crop_width = uv_w;
571 yv12->uv_crop_height = uv_h;
572 yv12->uv_width = uv_w;
573 yv12->uv_height = uv_h;
575 yv12->y_stride = img->stride[VPX_PLANE_Y];
576 yv12->uv_stride = img->stride[VPX_PLANE_U];
578 yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2;
583 static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
587 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
589 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
591 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
592 YV12_BUFFER_CONFIG sd;
594 image2yuvconfig(&frame->img, &sd);
596 return vp8dx_set_reference(ctx->yv12_frame_buffers.pbi[0],
597 frame->frame_type, &sd);
600 return VPX_CODEC_INVALID_PARAM;
604 static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
608 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
610 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
612 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
613 YV12_BUFFER_CONFIG sd;
615 image2yuvconfig(&frame->img, &sd);
617 return vp8dx_get_reference(ctx->yv12_frame_buffers.pbi[0],
618 frame->frame_type, &sd);
621 return VPX_CODEC_INVALID_PARAM;
625 static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
629 vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
633 ctx->postproc_cfg_set = 1;
634 ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data);
638 return VPX_CODEC_INVALID_PARAM;
643 return VPX_CODEC_INCAPABLE;
648 static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
650 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
651 ctx->dbg_color_ref_frame_flag = va_arg(args, int);
656 return VPX_CODEC_INCAPABLE;
660 static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
662 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
663 ctx->dbg_color_mb_modes_flag = va_arg(args, int);
668 return VPX_CODEC_INCAPABLE;
672 static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
674 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
675 ctx->dbg_color_b_modes_flag = va_arg(args, int);
680 return VPX_CODEC_INCAPABLE;
684 static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
686 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
687 ctx->dbg_display_mv_flag = va_arg(args, int);
692 return VPX_CODEC_INCAPABLE;
696 static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
699 int *update_info = va_arg(args, int *);
701 if (update_info && !ctx->yv12_frame_buffers.use_frame_threads)
703 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
705 *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME
706 + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME
707 + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME;
712 return VPX_CODEC_INVALID_PARAM;
715 extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame );
716 static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
719 int *ref_info = va_arg(args, int *);
721 if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads)
723 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
724 VP8_COMMON *oci = &pbi->common;
726 (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
727 (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
728 (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
733 return VPX_CODEC_INVALID_PARAM;
736 static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
740 int *corrupted = va_arg(args, int *);
741 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
743 if (corrupted && pbi)
745 const YV12_BUFFER_CONFIG *const frame = pbi->common.frame_to_show;
746 if (frame == NULL) return VPX_CODEC_ERROR;
747 *corrupted = frame->corrupted;
751 return VPX_CODEC_INVALID_PARAM;
755 static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx,
758 vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
762 ctx->decrypt_cb = init->decrypt_cb;
763 ctx->decrypt_state = init->decrypt_state;
767 ctx->decrypt_cb = NULL;
768 ctx->decrypt_state = NULL;
773 vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
775 {VP8_SET_REFERENCE, vp8_set_reference},
776 {VP8_COPY_REFERENCE, vp8_get_reference},
777 {VP8_SET_POSTPROC, vp8_set_postproc},
778 {VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame},
779 {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes},
780 {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes},
781 {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv},
782 {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates},
783 {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted},
784 {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame},
785 {VPXD_SET_DECRYPTOR, vp8_set_decryptor},
790 #ifndef VERSION_STRING
791 #define VERSION_STRING
793 CODEC_INTERFACE(vpx_codec_vp8_dx) =
795 "WebM Project VP8 Decoder" VERSION_STRING,
796 VPX_CODEC_INTERNAL_ABI_VERSION,
797 VPX_CODEC_CAP_DECODER | VP8_CAP_POSTPROC | VP8_CAP_ERROR_CONCEALMENT |
798 VPX_CODEC_CAP_INPUT_FRAGMENTS,
799 /* vpx_codec_caps_t caps; */
800 vp8_init, /* vpx_codec_init_fn_t init; */
801 vp8_destroy, /* vpx_codec_destroy_fn_t destroy; */
802 vp8_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */
804 vp8_peek_si, /* vpx_codec_peek_si_fn_t peek_si; */
805 vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */
806 vp8_decode, /* vpx_codec_decode_fn_t decode; */
807 vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
810 { /* encoder functions */