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 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t);
47 struct vpx_codec_alg_priv
49 vpx_codec_priv_t base;
50 vpx_codec_dec_cfg_t cfg;
54 vp8_postproc_cfg_t postproc_cfg;
55 #if CONFIG_POSTPROC_VISUALIZER
56 unsigned int dbg_postproc_flag;
57 int dbg_color_ref_frame_flag;
58 int dbg_color_mb_modes_flag;
59 int dbg_color_b_modes_flag;
60 int dbg_display_mv_flag;
62 vpx_decrypt_cb decrypt_cb;
66 struct frame_buffers yv12_frame_buffers;
68 FRAGMENT_DATA fragments;
71 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t flags)
73 /* Although this declaration is constant, we can't use it in the requested
74 * segments list because we want to define the requested segments list
75 * before defining the private type (so that the number of memory maps is
80 return sizeof(vpx_codec_alg_priv_t);
83 static void vp8_init_ctx(vpx_codec_ctx_t *ctx)
85 vpx_codec_alg_priv_t *priv =
86 (vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv));
88 ctx->priv = (vpx_codec_priv_t *)priv;
89 ctx->priv->init_flags = ctx->init_flags;
91 priv->si.sz = sizeof(priv->si);
92 priv->decrypt_cb = NULL;
93 priv->decrypt_state = NULL;
97 /* Update the reference to the config structure to an internal copy. */
98 priv->cfg = *ctx->config.dec;
99 ctx->config.dec = &priv->cfg;
103 static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
104 vpx_codec_priv_enc_mr_cfg_t *data)
106 vpx_codec_err_t res = VPX_CODEC_OK;
107 vpx_codec_alg_priv_t *priv = NULL;
114 /* This function only allocates space for the vpx_codec_alg_priv_t
115 * structure. More memory may be required at the time the stream
116 * information becomes known.
120 priv = (vpx_codec_alg_priv_t *)ctx->priv;
122 /* initialize number of fragments to zero */
123 priv->fragments.count = 0;
124 /* is input fragments enabled? */
125 priv->fragments.enabled =
126 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
128 /*post processing level initialized to do nothing */
130 priv = (vpx_codec_alg_priv_t *)ctx->priv;
133 priv->yv12_frame_buffers.use_frame_threads =
134 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING);
136 /* for now, disable frame threading */
137 priv->yv12_frame_buffers.use_frame_threads = 0;
139 if (priv->yv12_frame_buffers.use_frame_threads &&
140 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
141 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
142 /* row-based threading, error concealment, and input fragments will
143 * not be supported when using frame-based threading */
144 res = VPX_CODEC_INVALID_PARAM;
150 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx)
152 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers);
159 static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
160 unsigned int data_sz,
161 vpx_codec_stream_info_t *si,
162 vpx_decrypt_cb decrypt_cb,
165 vpx_codec_err_t res = VPX_CODEC_OK;
167 if(data + data_sz <= data)
169 res = VPX_CODEC_INVALID_PARAM;
173 /* Parse uncompresssed part of key frame header.
174 * 3 bytes:- including version, frame type and an offset
175 * 3 bytes:- sync code (0x9d, 0x01, 0x2a)
176 * 4 bytes:- including image width and height in the lowest 14 bits
177 * of each 2-byte value.
179 uint8_t clear_buffer[10];
180 const uint8_t *clear = data;
183 int n = MIN(sizeof(clear_buffer), data_sz);
184 decrypt_cb(decrypt_state, data, clear_buffer, n);
185 clear = clear_buffer;
189 if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
193 /* vet via sync code */
194 if (clear[3] != 0x9d || clear[4] != 0x01 || clear[5] != 0x2a)
195 return VPX_CODEC_UNSUP_BITSTREAM;
197 si->w = (clear[6] | (clear[7] << 8)) & 0x3fff;
198 si->h = (clear[8] | (clear[9] << 8)) & 0x3fff;
200 /*printf("w=%d, h=%d\n", si->w, si->h);*/
201 if (!(si->h | si->w))
202 res = VPX_CODEC_UNSUP_BITSTREAM;
206 res = VPX_CODEC_UNSUP_BITSTREAM;
213 static vpx_codec_err_t vp8_peek_si(const uint8_t *data,
214 unsigned int data_sz,
215 vpx_codec_stream_info_t *si) {
216 return vp8_peek_si_internal(data, data_sz, si, NULL, NULL);
219 static vpx_codec_err_t vp8_get_si(vpx_codec_alg_priv_t *ctx,
220 vpx_codec_stream_info_t *si)
225 if (si->sz >= sizeof(vp8_stream_info_t))
226 sz = sizeof(vp8_stream_info_t);
228 sz = sizeof(vpx_codec_stream_info_t);
230 memcpy(si, &ctx->si, sz);
237 static vpx_codec_err_t
238 update_error_state(vpx_codec_alg_priv_t *ctx,
239 const struct vpx_internal_error_info *error)
243 if ((res = error->error_code))
244 ctx->base.err_detail = error->has_detail
251 static void yuvconfig2image(vpx_image_t *img,
252 const YV12_BUFFER_CONFIG *yv12,
255 /** vpx_img_wrap() doesn't allow specifying independent strides for
256 * the Y, U, and V planes, nor other alignment adjustments that
257 * might be representable by a YV12_BUFFER_CONFIG, so we just
258 * initialize all the fields.*/
259 img->fmt = VPX_IMG_FMT_I420;
260 img->w = yv12->y_stride;
261 img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
262 img->d_w = yv12->y_width;
263 img->d_h = yv12->y_height;
264 img->x_chroma_shift = 1;
265 img->y_chroma_shift = 1;
266 img->planes[VPX_PLANE_Y] = yv12->y_buffer;
267 img->planes[VPX_PLANE_U] = yv12->u_buffer;
268 img->planes[VPX_PLANE_V] = yv12->v_buffer;
269 img->planes[VPX_PLANE_ALPHA] = NULL;
270 img->stride[VPX_PLANE_Y] = yv12->y_stride;
271 img->stride[VPX_PLANE_U] = yv12->uv_stride;
272 img->stride[VPX_PLANE_V] = yv12->uv_stride;
273 img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
276 img->user_priv = user_priv;
277 img->img_data = yv12->buffer_alloc;
278 img->img_data_owner = 0;
279 img->self_allocd = 0;
283 update_fragments(vpx_codec_alg_priv_t *ctx,
285 unsigned int data_sz,
286 vpx_codec_err_t *res)
290 if (ctx->fragments.count == 0)
292 /* New frame, reset fragment pointers and sizes */
293 memset((void*)ctx->fragments.ptrs, 0, sizeof(ctx->fragments.ptrs));
294 memset(ctx->fragments.sizes, 0, sizeof(ctx->fragments.sizes));
296 if (ctx->fragments.enabled && !(data == NULL && data_sz == 0))
298 /* Store a pointer to this fragment and return. We haven't
299 * received the complete frame yet, so we will wait with decoding.
301 ctx->fragments.ptrs[ctx->fragments.count] = data;
302 ctx->fragments.sizes[ctx->fragments.count] = data_sz;
303 ctx->fragments.count++;
304 if (ctx->fragments.count > (1 << EIGHT_PARTITION) + 1)
306 ctx->fragments.count = 0;
307 *res = VPX_CODEC_INVALID_PARAM;
313 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
318 if (!ctx->fragments.enabled)
320 ctx->fragments.ptrs[0] = data;
321 ctx->fragments.sizes[0] = data_sz;
322 ctx->fragments.count = 1;
328 static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
330 unsigned int data_sz,
334 vpx_codec_err_t res = VPX_CODEC_OK;
335 unsigned int resolution_change = 0;
338 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
343 /* Update the input fragment data */
344 if(update_fragments(ctx, data, data_sz, &res) <= 0)
347 /* Determine the stream parameters. Note that we rely on peek_si to
348 * validate that we have a buffer that does not wrap around the top
354 res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
355 &ctx->si, ctx->decrypt_cb, ctx->decrypt_state);
357 if((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf)
359 /* the peek function returns an error for non keyframes, however for
360 * this case, it is not an error */
364 if(!ctx->decoder_init && !ctx->si.is_kf)
365 res = VPX_CODEC_UNSUP_BITSTREAM;
367 if ((ctx->si.h != h) || (ctx->si.w != w))
368 resolution_change = 1;
370 /* Initialize the decoder instance on the first frame*/
371 if (!res && !ctx->decoder_init)
375 oxcf.Width = ctx->si.w;
376 oxcf.Height = ctx->si.h;
378 oxcf.postprocess = 0;
379 oxcf.max_threads = ctx->cfg.threads;
380 oxcf.error_concealment =
381 (ctx->base.init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT);
383 /* If postprocessing was enabled by the application and a
384 * configuration has not been provided, default it.
386 if (!ctx->postproc_cfg_set
387 && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
388 ctx->postproc_cfg.post_proc_flag =
389 VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE;
390 ctx->postproc_cfg.deblocking_level = 4;
391 ctx->postproc_cfg.noise_level = 0;
394 res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf);
395 ctx->decoder_init = 1;
398 /* Set these even if already initialized. The caller may have changed the
399 * decrypt config between frames.
401 if (ctx->decoder_init) {
402 ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
403 ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
408 VP8D_COMP *pbi = ctx->yv12_frame_buffers.pbi[0];
409 if (resolution_change)
411 VP8_COMMON *const pc = & pbi->common;
412 MACROBLOCKD *const xd = & pbi->mb;
413 #if CONFIG_MULTITHREAD
416 pc->Width = ctx->si.w;
417 pc->Height = ctx->si.h;
419 int prev_mb_rows = pc->mb_rows;
421 if (setjmp(pbi->common.error.jmp))
423 pbi->common.error.setjmp = 0;
424 vp8_clear_system_state();
425 /* same return value as used in vp8dx_receive_compressed_data */
429 pbi->common.error.setjmp = 1;
434 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
435 "Invalid frame width");
441 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
442 "Invalid frame height");
445 if (vp8_alloc_frame_buffers(pc, pc->Width, pc->Height))
446 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
447 "Failed to allocate frame buffers");
449 xd->pre = pc->yv12_fb[pc->lst_fb_idx];
450 xd->dst = pc->yv12_fb[pc->new_fb_idx];
452 #if CONFIG_MULTITHREAD
453 for (i = 0; i < pbi->allocated_decoding_thread_count; i++)
455 pbi->mb_row_di[i].mbd.dst = pc->yv12_fb[pc->new_fb_idx];
456 vp8_build_block_doffsets(&pbi->mb_row_di[i].mbd);
459 vp8_build_block_doffsets(&pbi->mb);
461 /* allocate memory for last frame MODE_INFO array */
462 #if CONFIG_ERROR_CONCEALMENT
466 /* old prev_mip was released by vp8_de_alloc_frame_buffers()
467 * called in vp8_alloc_frame_buffers() */
468 pc->prev_mip = vpx_calloc(
469 (pc->mb_cols + 1) * (pc->mb_rows + 1),
474 vp8_de_alloc_frame_buffers(pc);
475 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
477 "last frame MODE_INFO array");
480 pc->prev_mi = pc->prev_mip + pc->mode_info_stride + 1;
482 if (vp8_alloc_overlap_lists(pbi))
483 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
484 "Failed to allocate overlap lists "
485 "for error concealment");
490 #if CONFIG_MULTITHREAD
491 if (pbi->b_multithreaded_rd)
492 vp8mt_alloc_temp_buffers(pbi, pc->Width, prev_mb_rows);
498 pbi->common.error.setjmp = 0;
500 /* required to get past the first get_free_fb() call */
501 pbi->common.fb_idx_ref_cnt[0] = 0;
504 /* update the pbi fragment data */
505 pbi->fragments = ctx->fragments;
507 ctx->user_priv = user_priv;
508 if (vp8dx_receive_compressed_data(pbi, data_sz, data, deadline))
510 res = update_error_state(ctx, &pbi->common.error);
513 /* get ready for the next series of fragments */
514 ctx->fragments.count = 0;
520 static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
521 vpx_codec_iter_t *iter)
523 vpx_image_t *img = NULL;
525 /* iter acts as a flip flop, so an image is only returned on the first
528 if (!(*iter) && ctx->yv12_frame_buffers.pbi[0])
530 YV12_BUFFER_CONFIG sd;
531 int64_t time_stamp = 0, time_end_stamp = 0;
532 vp8_ppflags_t flags = {0};
534 if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
536 flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
537 #if CONFIG_POSTPROC_VISUALIZER
539 | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
540 | ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
541 | ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
542 | ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
545 flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
546 flags.noise_level = ctx->postproc_cfg.noise_level;
547 #if CONFIG_POSTPROC_VISUALIZER
548 flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
549 flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
550 flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
551 flags.display_mv_flag = ctx->dbg_display_mv_flag;
555 if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
556 &time_stamp, &time_end_stamp, &flags))
558 yuvconfig2image(&ctx->img, &sd, ctx->user_priv);
568 static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
569 YV12_BUFFER_CONFIG *yv12)
571 const int y_w = img->d_w;
572 const int y_h = img->d_h;
573 const int uv_w = (img->d_w + 1) / 2;
574 const int uv_h = (img->d_h + 1) / 2;
575 vpx_codec_err_t res = VPX_CODEC_OK;
576 yv12->y_buffer = img->planes[VPX_PLANE_Y];
577 yv12->u_buffer = img->planes[VPX_PLANE_U];
578 yv12->v_buffer = img->planes[VPX_PLANE_V];
580 yv12->y_crop_width = y_w;
581 yv12->y_crop_height = y_h;
583 yv12->y_height = y_h;
584 yv12->uv_crop_width = uv_w;
585 yv12->uv_crop_height = uv_h;
586 yv12->uv_width = uv_w;
587 yv12->uv_height = uv_h;
589 yv12->y_stride = img->stride[VPX_PLANE_Y];
590 yv12->uv_stride = img->stride[VPX_PLANE_U];
592 yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2;
597 static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
601 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
603 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
605 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
606 YV12_BUFFER_CONFIG sd;
608 image2yuvconfig(&frame->img, &sd);
610 return vp8dx_set_reference(ctx->yv12_frame_buffers.pbi[0],
611 frame->frame_type, &sd);
614 return VPX_CODEC_INVALID_PARAM;
618 static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
622 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
624 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
626 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
627 YV12_BUFFER_CONFIG sd;
629 image2yuvconfig(&frame->img, &sd);
631 return vp8dx_get_reference(ctx->yv12_frame_buffers.pbi[0],
632 frame->frame_type, &sd);
635 return VPX_CODEC_INVALID_PARAM;
639 static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
643 vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
647 ctx->postproc_cfg_set = 1;
648 ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data);
652 return VPX_CODEC_INVALID_PARAM;
657 return VPX_CODEC_INCAPABLE;
662 static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
664 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
665 ctx->dbg_color_ref_frame_flag = va_arg(args, int);
670 return VPX_CODEC_INCAPABLE;
674 static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
676 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
677 ctx->dbg_color_mb_modes_flag = va_arg(args, int);
682 return VPX_CODEC_INCAPABLE;
686 static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
688 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
689 ctx->dbg_color_b_modes_flag = va_arg(args, int);
694 return VPX_CODEC_INCAPABLE;
698 static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
700 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
701 ctx->dbg_display_mv_flag = va_arg(args, int);
706 return VPX_CODEC_INCAPABLE;
710 static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
713 int *update_info = va_arg(args, int *);
715 if (update_info && !ctx->yv12_frame_buffers.use_frame_threads)
717 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
719 *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME
720 + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME
721 + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME;
726 return VPX_CODEC_INVALID_PARAM;
729 extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame );
730 static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
733 int *ref_info = va_arg(args, int *);
735 if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads)
737 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
738 VP8_COMMON *oci = &pbi->common;
740 (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
741 (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
742 (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
747 return VPX_CODEC_INVALID_PARAM;
750 static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
754 int *corrupted = va_arg(args, int *);
755 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
757 if (corrupted && pbi)
759 const YV12_BUFFER_CONFIG *const frame = pbi->common.frame_to_show;
760 if (frame == NULL) return VPX_CODEC_ERROR;
761 *corrupted = frame->corrupted;
765 return VPX_CODEC_INVALID_PARAM;
769 static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx,
772 vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
776 ctx->decrypt_cb = init->decrypt_cb;
777 ctx->decrypt_state = init->decrypt_state;
781 ctx->decrypt_cb = NULL;
782 ctx->decrypt_state = NULL;
787 vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
789 {VP8_SET_REFERENCE, vp8_set_reference},
790 {VP8_COPY_REFERENCE, vp8_get_reference},
791 {VP8_SET_POSTPROC, vp8_set_postproc},
792 {VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame},
793 {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes},
794 {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes},
795 {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv},
796 {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates},
797 {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted},
798 {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame},
799 {VPXD_SET_DECRYPTOR, vp8_set_decryptor},
804 #ifndef VERSION_STRING
805 #define VERSION_STRING
807 CODEC_INTERFACE(vpx_codec_vp8_dx) =
809 "WebM Project VP8 Decoder" VERSION_STRING,
810 VPX_CODEC_INTERNAL_ABI_VERSION,
811 VPX_CODEC_CAP_DECODER | VP8_CAP_POSTPROC | VP8_CAP_ERROR_CONCEALMENT |
812 VPX_CODEC_CAP_INPUT_FRAGMENTS,
813 /* vpx_codec_caps_t caps; */
814 vp8_init, /* vpx_codec_init_fn_t init; */
815 vp8_destroy, /* vpx_codec_destroy_fn_t destroy; */
816 vp8_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */
818 vp8_peek_si, /* vpx_codec_peek_si_fn_t peek_si; */
819 vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */
820 vp8_decode, /* vpx_codec_decode_fn_t decode; */
821 vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
824 { /* encoder functions */