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.
15 #include "vpx/vpx_decoder.h"
16 #include "vpx/vp8dx.h"
17 #include "vpx/internal/vpx_codec_internal.h"
18 #include "vpx_version.h"
19 #include "common/alloccommon.h"
20 #include "common/common.h"
21 #include "common/onyxd.h"
22 #include "decoder/onyxd_int.h"
23 #include "vpx_mem/vpx_mem.h"
24 #if CONFIG_ERROR_CONCEALMENT
25 #include "decoder/error_concealment.h"
27 #include "decoder/decoderthreading.h"
29 #define VP8_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0)
30 #define VP8_CAP_ERROR_CONCEALMENT (CONFIG_ERROR_CONCEALMENT ? \
31 VPX_CODEC_CAP_ERROR_CONCEALMENT : 0)
33 typedef vpx_codec_stream_info_t vp8_stream_info_t;
35 /* Structures for handling memory allocations */
38 VP8_SEG_ALG_PRIV = 256,
41 #define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0])))
43 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t);
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 unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t flags)
71 /* Although this declaration is constant, we can't use it in the requested
72 * segments list because we want to define the requested segments list
73 * before defining the private type (so that the number of memory maps is
77 return sizeof(vpx_codec_alg_priv_t);
80 static void vp8_init_ctx(vpx_codec_ctx_t *ctx)
82 vpx_codec_alg_priv_t *priv =
83 (vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv));
85 ctx->priv = (vpx_codec_priv_t *)priv;
86 ctx->priv->init_flags = ctx->init_flags;
88 priv->si.sz = sizeof(priv->si);
89 priv->decrypt_cb = NULL;
90 priv->decrypt_state = NULL;
94 /* Update the reference to the config structure to an internal copy. */
95 priv->cfg = *ctx->config.dec;
96 ctx->config.dec = &priv->cfg;
100 static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
101 vpx_codec_priv_enc_mr_cfg_t *data)
103 vpx_codec_err_t res = VPX_CODEC_OK;
104 vpx_codec_alg_priv_t *priv = NULL;
109 /* This function only allocates space for the vpx_codec_alg_priv_t
110 * structure. More memory may be required at the time the stream
111 * information becomes known.
115 priv = (vpx_codec_alg_priv_t *)ctx->priv;
117 /* initialize number of fragments to zero */
118 priv->fragments.count = 0;
119 /* is input fragments enabled? */
120 priv->fragments.enabled =
121 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
123 /*post processing level initialized to do nothing */
125 priv = (vpx_codec_alg_priv_t *)ctx->priv;
128 priv->yv12_frame_buffers.use_frame_threads =
129 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING);
131 /* for now, disable frame threading */
132 priv->yv12_frame_buffers.use_frame_threads = 0;
134 if (priv->yv12_frame_buffers.use_frame_threads &&
135 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
136 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
137 /* row-based threading, error concealment, and input fragments will
138 * not be supported when using frame-based threading */
139 res = VPX_CODEC_INVALID_PARAM;
145 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx)
147 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers);
154 static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
155 unsigned int data_sz,
156 vpx_codec_stream_info_t *si,
157 vpx_decrypt_cb decrypt_cb,
160 vpx_codec_err_t res = VPX_CODEC_OK;
162 if(data + data_sz <= data)
164 res = VPX_CODEC_INVALID_PARAM;
168 /* Parse uncompresssed part of key frame header.
169 * 3 bytes:- including version, frame type and an offset
170 * 3 bytes:- sync code (0x9d, 0x01, 0x2a)
171 * 4 bytes:- including image width and height in the lowest 14 bits
172 * of each 2-byte value.
174 uint8_t clear_buffer[10];
175 const uint8_t *clear = data;
178 int n = MIN(sizeof(clear_buffer), data_sz);
179 decrypt_cb(decrypt_state, data, clear_buffer, n);
180 clear = clear_buffer;
184 if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
188 /* vet via sync code */
189 if (clear[3] != 0x9d || clear[4] != 0x01 || clear[5] != 0x2a)
190 res = VPX_CODEC_UNSUP_BITSTREAM;
192 si->w = (clear[6] | (clear[7] << 8)) & 0x3fff;
193 si->h = (clear[8] | (clear[9] << 8)) & 0x3fff;
195 /*printf("w=%d, h=%d\n", si->w, si->h);*/
196 if (!(si->h | si->w))
197 res = VPX_CODEC_UNSUP_BITSTREAM;
201 res = VPX_CODEC_UNSUP_BITSTREAM;
208 static vpx_codec_err_t vp8_peek_si(const uint8_t *data,
209 unsigned int data_sz,
210 vpx_codec_stream_info_t *si) {
211 return vp8_peek_si_internal(data, data_sz, si, NULL, NULL);
214 static vpx_codec_err_t vp8_get_si(vpx_codec_alg_priv_t *ctx,
215 vpx_codec_stream_info_t *si)
220 if (si->sz >= sizeof(vp8_stream_info_t))
221 sz = sizeof(vp8_stream_info_t);
223 sz = sizeof(vpx_codec_stream_info_t);
225 memcpy(si, &ctx->si, sz);
232 static vpx_codec_err_t
233 update_error_state(vpx_codec_alg_priv_t *ctx,
234 const struct vpx_internal_error_info *error)
238 if ((res = error->error_code))
239 ctx->base.err_detail = error->has_detail
246 static void yuvconfig2image(vpx_image_t *img,
247 const YV12_BUFFER_CONFIG *yv12,
250 /** vpx_img_wrap() doesn't allow specifying independent strides for
251 * the Y, U, and V planes, nor other alignment adjustments that
252 * might be representable by a YV12_BUFFER_CONFIG, so we just
253 * initialize all the fields.*/
254 img->fmt = VPX_IMG_FMT_I420;
255 img->w = yv12->y_stride;
256 img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
257 img->d_w = yv12->y_width;
258 img->d_h = yv12->y_height;
259 img->x_chroma_shift = 1;
260 img->y_chroma_shift = 1;
261 img->planes[VPX_PLANE_Y] = yv12->y_buffer;
262 img->planes[VPX_PLANE_U] = yv12->u_buffer;
263 img->planes[VPX_PLANE_V] = yv12->v_buffer;
264 img->planes[VPX_PLANE_ALPHA] = NULL;
265 img->stride[VPX_PLANE_Y] = yv12->y_stride;
266 img->stride[VPX_PLANE_U] = yv12->uv_stride;
267 img->stride[VPX_PLANE_V] = yv12->uv_stride;
268 img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
271 img->user_priv = user_priv;
272 img->img_data = yv12->buffer_alloc;
273 img->img_data_owner = 0;
274 img->self_allocd = 0;
278 update_fragments(vpx_codec_alg_priv_t *ctx,
280 unsigned int data_sz,
281 vpx_codec_err_t *res)
285 if (ctx->fragments.count == 0)
287 /* New frame, reset fragment pointers and sizes */
288 vpx_memset((void*)ctx->fragments.ptrs, 0, sizeof(ctx->fragments.ptrs));
289 vpx_memset(ctx->fragments.sizes, 0, sizeof(ctx->fragments.sizes));
291 if (ctx->fragments.enabled && !(data == NULL && data_sz == 0))
293 /* Store a pointer to this fragment and return. We haven't
294 * received the complete frame yet, so we will wait with decoding.
296 ctx->fragments.ptrs[ctx->fragments.count] = data;
297 ctx->fragments.sizes[ctx->fragments.count] = data_sz;
298 ctx->fragments.count++;
299 if (ctx->fragments.count > (1 << EIGHT_PARTITION) + 1)
301 ctx->fragments.count = 0;
302 *res = VPX_CODEC_INVALID_PARAM;
308 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
313 if (!ctx->fragments.enabled)
315 ctx->fragments.ptrs[0] = data;
316 ctx->fragments.sizes[0] = data_sz;
317 ctx->fragments.count = 1;
323 static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
325 unsigned int data_sz,
329 vpx_codec_err_t res = VPX_CODEC_OK;
330 unsigned int resolution_change = 0;
333 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
338 /* Update the input fragment data */
339 if(update_fragments(ctx, data, data_sz, &res) <= 0)
342 /* Determine the stream parameters. Note that we rely on peek_si to
343 * validate that we have a buffer that does not wrap around the top
349 res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
350 &ctx->si, ctx->decrypt_cb, ctx->decrypt_state);
352 if((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf)
354 /* the peek function returns an error for non keyframes, however for
355 * this case, it is not an error */
359 if(!ctx->decoder_init && !ctx->si.is_kf)
360 res = VPX_CODEC_UNSUP_BITSTREAM;
362 if ((ctx->si.h != h) || (ctx->si.w != w))
363 resolution_change = 1;
365 /* Initialize the decoder instance on the first frame*/
366 if (!res && !ctx->decoder_init)
370 oxcf.Width = ctx->si.w;
371 oxcf.Height = ctx->si.h;
373 oxcf.postprocess = 0;
374 oxcf.max_threads = ctx->cfg.threads;
375 oxcf.error_concealment =
376 (ctx->base.init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT);
378 /* If postprocessing was enabled by the application and a
379 * configuration has not been provided, default it.
381 if (!ctx->postproc_cfg_set
382 && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
383 ctx->postproc_cfg.post_proc_flag =
384 VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE;
385 ctx->postproc_cfg.deblocking_level = 4;
386 ctx->postproc_cfg.noise_level = 0;
389 res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf);
390 ctx->decoder_init = 1;
393 /* Set these even if already initialized. The caller may have changed the
394 * decrypt config between frames.
396 if (ctx->decoder_init) {
397 ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
398 ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
403 VP8D_COMP *pbi = ctx->yv12_frame_buffers.pbi[0];
404 if(resolution_change)
406 VP8_COMMON *const pc = & pbi->common;
407 MACROBLOCKD *const xd = & pbi->mb;
408 #if CONFIG_MULTITHREAD
411 pc->Width = ctx->si.w;
412 pc->Height = ctx->si.h;
414 int prev_mb_rows = pc->mb_rows;
416 if (setjmp(pbi->common.error.jmp))
418 pbi->common.error.setjmp = 0;
419 vp8_clear_system_state();
420 /* same return value as used in vp8dx_receive_compressed_data */
424 pbi->common.error.setjmp = 1;
429 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
430 "Invalid frame width");
436 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
437 "Invalid frame height");
440 if (vp8_alloc_frame_buffers(pc, pc->Width, pc->Height))
441 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
442 "Failed to allocate frame buffers");
444 xd->pre = pc->yv12_fb[pc->lst_fb_idx];
445 xd->dst = pc->yv12_fb[pc->new_fb_idx];
447 #if CONFIG_MULTITHREAD
448 for (i = 0; i < pbi->allocated_decoding_thread_count; i++)
450 pbi->mb_row_di[i].mbd.dst = pc->yv12_fb[pc->new_fb_idx];
451 vp8_build_block_doffsets(&pbi->mb_row_di[i].mbd);
454 vp8_build_block_doffsets(&pbi->mb);
456 /* allocate memory for last frame MODE_INFO array */
457 #if CONFIG_ERROR_CONCEALMENT
461 /* old prev_mip was released by vp8_de_alloc_frame_buffers()
462 * called in vp8_alloc_frame_buffers() */
463 pc->prev_mip = vpx_calloc(
464 (pc->mb_cols + 1) * (pc->mb_rows + 1),
469 vp8_de_alloc_frame_buffers(pc);
470 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
472 "last frame MODE_INFO array");
475 pc->prev_mi = pc->prev_mip + pc->mode_info_stride + 1;
477 if (vp8_alloc_overlap_lists(pbi))
478 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
479 "Failed to allocate overlap lists "
480 "for error concealment");
485 #if CONFIG_MULTITHREAD
486 if (pbi->b_multithreaded_rd)
487 vp8mt_alloc_temp_buffers(pbi, pc->Width, prev_mb_rows);
493 pbi->common.error.setjmp = 0;
495 /* required to get past the first get_free_fb() call */
496 pbi->common.fb_idx_ref_cnt[0] = 0;
499 /* update the pbi fragment data */
500 pbi->fragments = ctx->fragments;
502 ctx->user_priv = user_priv;
503 if (vp8dx_receive_compressed_data(pbi, data_sz, data, deadline))
505 res = update_error_state(ctx, &pbi->common.error);
508 /* get ready for the next series of fragments */
509 ctx->fragments.count = 0;
515 static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
516 vpx_codec_iter_t *iter)
518 vpx_image_t *img = NULL;
520 /* iter acts as a flip flop, so an image is only returned on the first
523 if (!(*iter) && ctx->yv12_frame_buffers.pbi[0])
525 YV12_BUFFER_CONFIG sd;
526 int64_t time_stamp = 0, time_end_stamp = 0;
527 vp8_ppflags_t flags = {0};
529 if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
531 flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
532 #if CONFIG_POSTPROC_VISUALIZER
534 | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
535 | ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
536 | ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
537 | ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
540 flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
541 flags.noise_level = ctx->postproc_cfg.noise_level;
542 #if CONFIG_POSTPROC_VISUALIZER
543 flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
544 flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
545 flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
546 flags.display_mv_flag = ctx->dbg_display_mv_flag;
550 if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
551 &time_stamp, &time_end_stamp, &flags))
553 yuvconfig2image(&ctx->img, &sd, ctx->user_priv);
563 static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
564 YV12_BUFFER_CONFIG *yv12)
566 const int y_w = img->d_w;
567 const int y_h = img->d_h;
568 const int uv_w = (img->d_w + 1) / 2;
569 const int uv_h = (img->d_h + 1) / 2;
570 vpx_codec_err_t res = VPX_CODEC_OK;
571 yv12->y_buffer = img->planes[VPX_PLANE_Y];
572 yv12->u_buffer = img->planes[VPX_PLANE_U];
573 yv12->v_buffer = img->planes[VPX_PLANE_V];
575 yv12->y_crop_width = y_w;
576 yv12->y_crop_height = y_h;
578 yv12->y_height = y_h;
579 yv12->uv_crop_width = uv_w;
580 yv12->uv_crop_height = uv_h;
581 yv12->uv_width = uv_w;
582 yv12->uv_height = uv_h;
584 yv12->y_stride = img->stride[VPX_PLANE_Y];
585 yv12->uv_stride = img->stride[VPX_PLANE_U];
587 yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2;
592 static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
596 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
598 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
600 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
601 YV12_BUFFER_CONFIG sd;
603 image2yuvconfig(&frame->img, &sd);
605 return vp8dx_set_reference(ctx->yv12_frame_buffers.pbi[0],
606 frame->frame_type, &sd);
609 return VPX_CODEC_INVALID_PARAM;
613 static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
617 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
619 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
621 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
622 YV12_BUFFER_CONFIG sd;
624 image2yuvconfig(&frame->img, &sd);
626 return vp8dx_get_reference(ctx->yv12_frame_buffers.pbi[0],
627 frame->frame_type, &sd);
630 return VPX_CODEC_INVALID_PARAM;
634 static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
638 vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
642 ctx->postproc_cfg_set = 1;
643 ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data);
647 return VPX_CODEC_INVALID_PARAM;
650 return VPX_CODEC_INCAPABLE;
655 static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
657 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
658 ctx->dbg_color_ref_frame_flag = va_arg(args, int);
663 return VPX_CODEC_INCAPABLE;
667 static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
669 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
670 ctx->dbg_color_mb_modes_flag = va_arg(args, int);
675 return VPX_CODEC_INCAPABLE;
679 static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
681 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
682 ctx->dbg_color_b_modes_flag = va_arg(args, int);
687 return VPX_CODEC_INCAPABLE;
691 static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
693 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
694 ctx->dbg_display_mv_flag = va_arg(args, int);
699 return VPX_CODEC_INCAPABLE;
703 static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
706 int *update_info = va_arg(args, int *);
708 if (update_info && !ctx->yv12_frame_buffers.use_frame_threads)
710 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
712 *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME
713 + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME
714 + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME;
719 return VPX_CODEC_INVALID_PARAM;
722 extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame );
723 static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
726 int *ref_info = va_arg(args, int *);
728 if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads)
730 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
731 VP8_COMMON *oci = &pbi->common;
733 (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
734 (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
735 (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
740 return VPX_CODEC_INVALID_PARAM;
743 static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
747 int *corrupted = va_arg(args, int *);
748 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
750 if (corrupted && pbi)
752 const YV12_BUFFER_CONFIG *const frame = pbi->common.frame_to_show;
753 if (frame == NULL) return VPX_CODEC_ERROR;
754 *corrupted = frame->corrupted;
758 return VPX_CODEC_INVALID_PARAM;
762 static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx,
765 vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
769 ctx->decrypt_cb = init->decrypt_cb;
770 ctx->decrypt_state = init->decrypt_state;
774 ctx->decrypt_cb = NULL;
775 ctx->decrypt_state = NULL;
780 vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
782 {VP8_SET_REFERENCE, vp8_set_reference},
783 {VP8_COPY_REFERENCE, vp8_get_reference},
784 {VP8_SET_POSTPROC, vp8_set_postproc},
785 {VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame},
786 {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes},
787 {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes},
788 {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv},
789 {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates},
790 {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted},
791 {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame},
792 {VPXD_SET_DECRYPTOR, vp8_set_decryptor},
797 #ifndef VERSION_STRING
798 #define VERSION_STRING
800 CODEC_INTERFACE(vpx_codec_vp8_dx) =
802 "WebM Project VP8 Decoder" VERSION_STRING,
803 VPX_CODEC_INTERNAL_ABI_VERSION,
804 VPX_CODEC_CAP_DECODER | VP8_CAP_POSTPROC | VP8_CAP_ERROR_CONCEALMENT |
805 VPX_CODEC_CAP_INPUT_FRAGMENTS,
806 /* vpx_codec_caps_t caps; */
807 vp8_init, /* vpx_codec_init_fn_t init; */
808 vp8_destroy, /* vpx_codec_destroy_fn_t destroy; */
809 vp8_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */
811 vp8_peek_si, /* vpx_codec_peek_si_fn_t peek_si; */
812 vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */
813 vp8_decode, /* vpx_codec_decode_fn_t decode; */
814 vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
817 { /* encoder functions */