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_scale_rtcd.h"
16 #include "vpx/vpx_decoder.h"
17 #include "vpx/vp8dx.h"
18 #include "vpx/internal/vpx_codec_internal.h"
19 #include "vpx_version.h"
20 #include "common/alloccommon.h"
21 #include "common/common.h"
22 #include "common/onyxd.h"
23 #include "decoder/onyxd_int.h"
24 #include "vpx_mem/vpx_mem.h"
25 #if CONFIG_ERROR_CONCEALMENT
26 #include "decoder/error_concealment.h"
28 #include "decoder/decoderthreading.h"
30 #define VP8_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0)
31 #define VP8_CAP_ERROR_CONCEALMENT (CONFIG_ERROR_CONCEALMENT ? \
32 VPX_CODEC_CAP_ERROR_CONCEALMENT : 0)
34 typedef vpx_codec_stream_info_t vp8_stream_info_t;
36 /* Structures for handling memory allocations */
39 VP8_SEG_ALG_PRIV = 256,
42 #define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0])))
44 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t);
46 struct vpx_codec_alg_priv
48 vpx_codec_priv_t base;
49 vpx_codec_dec_cfg_t cfg;
53 vp8_postproc_cfg_t postproc_cfg;
54 #if CONFIG_POSTPROC_VISUALIZER
55 unsigned int dbg_postproc_flag;
56 int dbg_color_ref_frame_flag;
57 int dbg_color_mb_modes_flag;
58 int dbg_color_b_modes_flag;
59 int dbg_display_mv_flag;
61 vpx_decrypt_cb decrypt_cb;
65 struct frame_buffers yv12_frame_buffers;
67 FRAGMENT_DATA fragments;
70 static unsigned long vp8_priv_sz(const vpx_codec_dec_cfg_t *si, vpx_codec_flags_t flags)
72 /* Although this declaration is constant, we can't use it in the requested
73 * segments list because we want to define the requested segments list
74 * before defining the private type (so that the number of memory maps is
79 return sizeof(vpx_codec_alg_priv_t);
82 static void vp8_init_ctx(vpx_codec_ctx_t *ctx)
84 vpx_codec_alg_priv_t *priv =
85 (vpx_codec_alg_priv_t *)vpx_calloc(1, sizeof(*priv));
87 ctx->priv = (vpx_codec_priv_t *)priv;
88 ctx->priv->init_flags = ctx->init_flags;
90 priv->si.sz = sizeof(priv->si);
91 priv->decrypt_cb = NULL;
92 priv->decrypt_state = NULL;
96 /* Update the reference to the config structure to an internal copy. */
97 priv->cfg = *ctx->config.dec;
98 ctx->config.dec = &priv->cfg;
102 static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx,
103 vpx_codec_priv_enc_mr_cfg_t *data)
105 vpx_codec_err_t res = VPX_CODEC_OK;
106 vpx_codec_alg_priv_t *priv = NULL;
112 /* This function only allocates space for the vpx_codec_alg_priv_t
113 * structure. More memory may be required at the time the stream
114 * information becomes known.
118 priv = (vpx_codec_alg_priv_t *)ctx->priv;
120 /* initialize number of fragments to zero */
121 priv->fragments.count = 0;
122 /* is input fragments enabled? */
123 priv->fragments.enabled =
124 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
126 /*post processing level initialized to do nothing */
128 priv = (vpx_codec_alg_priv_t *)ctx->priv;
131 priv->yv12_frame_buffers.use_frame_threads =
132 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING);
134 /* for now, disable frame threading */
135 priv->yv12_frame_buffers.use_frame_threads = 0;
137 if (priv->yv12_frame_buffers.use_frame_threads &&
138 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
139 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
140 /* row-based threading, error concealment, and input fragments will
141 * not be supported when using frame-based threading */
142 res = VPX_CODEC_INVALID_PARAM;
148 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx)
150 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers);
157 static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
158 unsigned int data_sz,
159 vpx_codec_stream_info_t *si,
160 vpx_decrypt_cb decrypt_cb,
163 vpx_codec_err_t res = VPX_CODEC_OK;
165 if(data + data_sz <= data)
167 res = VPX_CODEC_INVALID_PARAM;
171 /* Parse uncompresssed part of key frame header.
172 * 3 bytes:- including version, frame type and an offset
173 * 3 bytes:- sync code (0x9d, 0x01, 0x2a)
174 * 4 bytes:- including image width and height in the lowest 14 bits
175 * of each 2-byte value.
177 uint8_t clear_buffer[10];
178 const uint8_t *clear = data;
181 int n = MIN(sizeof(clear_buffer), data_sz);
182 decrypt_cb(decrypt_state, data, clear_buffer, n);
183 clear = clear_buffer;
187 if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
191 /* vet via sync code */
192 if (clear[3] != 0x9d || clear[4] != 0x01 || clear[5] != 0x2a)
193 return VPX_CODEC_UNSUP_BITSTREAM;
195 si->w = (clear[6] | (clear[7] << 8)) & 0x3fff;
196 si->h = (clear[8] | (clear[9] << 8)) & 0x3fff;
198 /*printf("w=%d, h=%d\n", si->w, si->h);*/
199 if (!(si->h | si->w))
200 res = VPX_CODEC_UNSUP_BITSTREAM;
204 res = VPX_CODEC_UNSUP_BITSTREAM;
211 static vpx_codec_err_t vp8_peek_si(const uint8_t *data,
212 unsigned int data_sz,
213 vpx_codec_stream_info_t *si) {
214 return vp8_peek_si_internal(data, data_sz, si, NULL, NULL);
217 static vpx_codec_err_t vp8_get_si(vpx_codec_alg_priv_t *ctx,
218 vpx_codec_stream_info_t *si)
223 if (si->sz >= sizeof(vp8_stream_info_t))
224 sz = sizeof(vp8_stream_info_t);
226 sz = sizeof(vpx_codec_stream_info_t);
228 memcpy(si, &ctx->si, sz);
235 static vpx_codec_err_t
236 update_error_state(vpx_codec_alg_priv_t *ctx,
237 const struct vpx_internal_error_info *error)
241 if ((res = error->error_code))
242 ctx->base.err_detail = error->has_detail
249 static void yuvconfig2image(vpx_image_t *img,
250 const YV12_BUFFER_CONFIG *yv12,
253 /** vpx_img_wrap() doesn't allow specifying independent strides for
254 * the Y, U, and V planes, nor other alignment adjustments that
255 * might be representable by a YV12_BUFFER_CONFIG, so we just
256 * initialize all the fields.*/
257 img->fmt = VPX_IMG_FMT_I420;
258 img->w = yv12->y_stride;
259 img->h = (yv12->y_height + 2 * VP8BORDERINPIXELS + 15) & ~15;
260 img->d_w = yv12->y_width;
261 img->d_h = yv12->y_height;
262 img->x_chroma_shift = 1;
263 img->y_chroma_shift = 1;
264 img->planes[VPX_PLANE_Y] = yv12->y_buffer;
265 img->planes[VPX_PLANE_U] = yv12->u_buffer;
266 img->planes[VPX_PLANE_V] = yv12->v_buffer;
267 img->planes[VPX_PLANE_ALPHA] = NULL;
268 img->stride[VPX_PLANE_Y] = yv12->y_stride;
269 img->stride[VPX_PLANE_U] = yv12->uv_stride;
270 img->stride[VPX_PLANE_V] = yv12->uv_stride;
271 img->stride[VPX_PLANE_ALPHA] = yv12->y_stride;
274 img->user_priv = user_priv;
275 img->img_data = yv12->buffer_alloc;
276 img->img_data_owner = 0;
277 img->self_allocd = 0;
281 update_fragments(vpx_codec_alg_priv_t *ctx,
283 unsigned int data_sz,
284 vpx_codec_err_t *res)
288 if (ctx->fragments.count == 0)
290 /* New frame, reset fragment pointers and sizes */
291 vpx_memset((void*)ctx->fragments.ptrs, 0, sizeof(ctx->fragments.ptrs));
292 vpx_memset(ctx->fragments.sizes, 0, sizeof(ctx->fragments.sizes));
294 if (ctx->fragments.enabled && !(data == NULL && data_sz == 0))
296 /* Store a pointer to this fragment and return. We haven't
297 * received the complete frame yet, so we will wait with decoding.
299 ctx->fragments.ptrs[ctx->fragments.count] = data;
300 ctx->fragments.sizes[ctx->fragments.count] = data_sz;
301 ctx->fragments.count++;
302 if (ctx->fragments.count > (1 << EIGHT_PARTITION) + 1)
304 ctx->fragments.count = 0;
305 *res = VPX_CODEC_INVALID_PARAM;
311 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
316 if (!ctx->fragments.enabled)
318 ctx->fragments.ptrs[0] = data;
319 ctx->fragments.sizes[0] = data_sz;
320 ctx->fragments.count = 1;
326 static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
328 unsigned int data_sz,
332 vpx_codec_err_t res = VPX_CODEC_OK;
333 unsigned int resolution_change = 0;
336 if (!ctx->fragments.enabled && (data == NULL && data_sz == 0))
341 /* Update the input fragment data */
342 if(update_fragments(ctx, data, data_sz, &res) <= 0)
345 /* Determine the stream parameters. Note that we rely on peek_si to
346 * validate that we have a buffer that does not wrap around the top
352 res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
353 &ctx->si, ctx->decrypt_cb, ctx->decrypt_state);
355 if((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf)
357 /* the peek function returns an error for non keyframes, however for
358 * this case, it is not an error */
362 if(!ctx->decoder_init && !ctx->si.is_kf)
363 res = VPX_CODEC_UNSUP_BITSTREAM;
365 if ((ctx->si.h != h) || (ctx->si.w != w))
366 resolution_change = 1;
368 /* Initialize the decoder instance on the first frame*/
369 if (!res && !ctx->decoder_init)
373 oxcf.Width = ctx->si.w;
374 oxcf.Height = ctx->si.h;
376 oxcf.postprocess = 0;
377 oxcf.max_threads = ctx->cfg.threads;
378 oxcf.error_concealment =
379 (ctx->base.init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT);
381 /* If postprocessing was enabled by the application and a
382 * configuration has not been provided, default it.
384 if (!ctx->postproc_cfg_set
385 && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
386 ctx->postproc_cfg.post_proc_flag =
387 VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE;
388 ctx->postproc_cfg.deblocking_level = 4;
389 ctx->postproc_cfg.noise_level = 0;
392 res = vp8_create_decoder_instances(&ctx->yv12_frame_buffers, &oxcf);
393 ctx->decoder_init = 1;
396 /* Set these even if already initialized. The caller may have changed the
397 * decrypt config between frames.
399 if (ctx->decoder_init) {
400 ctx->yv12_frame_buffers.pbi[0]->decrypt_cb = ctx->decrypt_cb;
401 ctx->yv12_frame_buffers.pbi[0]->decrypt_state = ctx->decrypt_state;
406 VP8D_COMP *pbi = ctx->yv12_frame_buffers.pbi[0];
407 if (resolution_change)
409 VP8_COMMON *const pc = & pbi->common;
410 MACROBLOCKD *const xd = & pbi->mb;
411 #if CONFIG_MULTITHREAD
414 pc->Width = ctx->si.w;
415 pc->Height = ctx->si.h;
417 int prev_mb_rows = pc->mb_rows;
419 if (setjmp(pbi->common.error.jmp))
421 pbi->common.error.setjmp = 0;
422 vp8_clear_system_state();
423 /* same return value as used in vp8dx_receive_compressed_data */
427 pbi->common.error.setjmp = 1;
432 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
433 "Invalid frame width");
439 vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
440 "Invalid frame height");
443 if (vp8_alloc_frame_buffers(pc, pc->Width, pc->Height))
444 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
445 "Failed to allocate frame buffers");
447 xd->pre = pc->yv12_fb[pc->lst_fb_idx];
448 xd->dst = pc->yv12_fb[pc->new_fb_idx];
450 #if CONFIG_MULTITHREAD
451 for (i = 0; i < pbi->allocated_decoding_thread_count; i++)
453 pbi->mb_row_di[i].mbd.dst = pc->yv12_fb[pc->new_fb_idx];
454 vp8_build_block_doffsets(&pbi->mb_row_di[i].mbd);
457 vp8_build_block_doffsets(&pbi->mb);
459 /* allocate memory for last frame MODE_INFO array */
460 #if CONFIG_ERROR_CONCEALMENT
464 /* old prev_mip was released by vp8_de_alloc_frame_buffers()
465 * called in vp8_alloc_frame_buffers() */
466 pc->prev_mip = vpx_calloc(
467 (pc->mb_cols + 1) * (pc->mb_rows + 1),
472 vp8_de_alloc_frame_buffers(pc);
473 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
475 "last frame MODE_INFO array");
478 pc->prev_mi = pc->prev_mip + pc->mode_info_stride + 1;
480 if (vp8_alloc_overlap_lists(pbi))
481 vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
482 "Failed to allocate overlap lists "
483 "for error concealment");
488 #if CONFIG_MULTITHREAD
489 if (pbi->b_multithreaded_rd)
490 vp8mt_alloc_temp_buffers(pbi, pc->Width, prev_mb_rows);
496 pbi->common.error.setjmp = 0;
498 /* required to get past the first get_free_fb() call */
499 pbi->common.fb_idx_ref_cnt[0] = 0;
502 /* update the pbi fragment data */
503 pbi->fragments = ctx->fragments;
505 ctx->user_priv = user_priv;
506 if (vp8dx_receive_compressed_data(pbi, data_sz, data, deadline))
508 res = update_error_state(ctx, &pbi->common.error);
511 /* get ready for the next series of fragments */
512 ctx->fragments.count = 0;
518 static vpx_image_t *vp8_get_frame(vpx_codec_alg_priv_t *ctx,
519 vpx_codec_iter_t *iter)
521 vpx_image_t *img = NULL;
523 /* iter acts as a flip flop, so an image is only returned on the first
526 if (!(*iter) && ctx->yv12_frame_buffers.pbi[0])
528 YV12_BUFFER_CONFIG sd;
529 int64_t time_stamp = 0, time_end_stamp = 0;
530 vp8_ppflags_t flags = {0};
532 if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)
534 flags.post_proc_flag= ctx->postproc_cfg.post_proc_flag
535 #if CONFIG_POSTPROC_VISUALIZER
537 | ((ctx->dbg_color_ref_frame_flag != 0) ? VP8D_DEBUG_CLR_FRM_REF_BLKS : 0)
538 | ((ctx->dbg_color_mb_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
539 | ((ctx->dbg_color_b_modes_flag != 0) ? VP8D_DEBUG_CLR_BLK_MODES : 0)
540 | ((ctx->dbg_display_mv_flag != 0) ? VP8D_DEBUG_DRAW_MV : 0)
543 flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
544 flags.noise_level = ctx->postproc_cfg.noise_level;
545 #if CONFIG_POSTPROC_VISUALIZER
546 flags.display_ref_frame_flag= ctx->dbg_color_ref_frame_flag;
547 flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
548 flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
549 flags.display_mv_flag = ctx->dbg_display_mv_flag;
553 if (0 == vp8dx_get_raw_frame(ctx->yv12_frame_buffers.pbi[0], &sd,
554 &time_stamp, &time_end_stamp, &flags))
556 yuvconfig2image(&ctx->img, &sd, ctx->user_priv);
566 static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
567 YV12_BUFFER_CONFIG *yv12)
569 const int y_w = img->d_w;
570 const int y_h = img->d_h;
571 const int uv_w = (img->d_w + 1) / 2;
572 const int uv_h = (img->d_h + 1) / 2;
573 vpx_codec_err_t res = VPX_CODEC_OK;
574 yv12->y_buffer = img->planes[VPX_PLANE_Y];
575 yv12->u_buffer = img->planes[VPX_PLANE_U];
576 yv12->v_buffer = img->planes[VPX_PLANE_V];
578 yv12->y_crop_width = y_w;
579 yv12->y_crop_height = y_h;
581 yv12->y_height = y_h;
582 yv12->uv_crop_width = uv_w;
583 yv12->uv_crop_height = uv_h;
584 yv12->uv_width = uv_w;
585 yv12->uv_height = uv_h;
587 yv12->y_stride = img->stride[VPX_PLANE_Y];
588 yv12->uv_stride = img->stride[VPX_PLANE_U];
590 yv12->border = (img->stride[VPX_PLANE_Y] - img->d_w) / 2;
595 static vpx_codec_err_t vp8_set_reference(vpx_codec_alg_priv_t *ctx,
599 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
601 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
603 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
604 YV12_BUFFER_CONFIG sd;
606 image2yuvconfig(&frame->img, &sd);
608 return vp8dx_set_reference(ctx->yv12_frame_buffers.pbi[0],
609 frame->frame_type, &sd);
612 return VPX_CODEC_INVALID_PARAM;
616 static vpx_codec_err_t vp8_get_reference(vpx_codec_alg_priv_t *ctx,
620 vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
622 if (data && !ctx->yv12_frame_buffers.use_frame_threads)
624 vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
625 YV12_BUFFER_CONFIG sd;
627 image2yuvconfig(&frame->img, &sd);
629 return vp8dx_get_reference(ctx->yv12_frame_buffers.pbi[0],
630 frame->frame_type, &sd);
633 return VPX_CODEC_INVALID_PARAM;
637 static vpx_codec_err_t vp8_set_postproc(vpx_codec_alg_priv_t *ctx,
641 vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
645 ctx->postproc_cfg_set = 1;
646 ctx->postproc_cfg = *((vp8_postproc_cfg_t *)data);
650 return VPX_CODEC_INVALID_PARAM;
655 return VPX_CODEC_INCAPABLE;
660 static vpx_codec_err_t vp8_set_dbg_color_ref_frame(vpx_codec_alg_priv_t *ctx,
662 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
663 ctx->dbg_color_ref_frame_flag = va_arg(args, int);
668 return VPX_CODEC_INCAPABLE;
672 static vpx_codec_err_t vp8_set_dbg_color_mb_modes(vpx_codec_alg_priv_t *ctx,
674 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
675 ctx->dbg_color_mb_modes_flag = va_arg(args, int);
680 return VPX_CODEC_INCAPABLE;
684 static vpx_codec_err_t vp8_set_dbg_color_b_modes(vpx_codec_alg_priv_t *ctx,
686 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
687 ctx->dbg_color_b_modes_flag = va_arg(args, int);
692 return VPX_CODEC_INCAPABLE;
696 static vpx_codec_err_t vp8_set_dbg_display_mv(vpx_codec_alg_priv_t *ctx,
698 #if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
699 ctx->dbg_display_mv_flag = va_arg(args, int);
704 return VPX_CODEC_INCAPABLE;
708 static vpx_codec_err_t vp8_get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
711 int *update_info = va_arg(args, int *);
713 if (update_info && !ctx->yv12_frame_buffers.use_frame_threads)
715 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
717 *update_info = pbi->common.refresh_alt_ref_frame * (int) VP8_ALTR_FRAME
718 + pbi->common.refresh_golden_frame * (int) VP8_GOLD_FRAME
719 + pbi->common.refresh_last_frame * (int) VP8_LAST_FRAME;
724 return VPX_CODEC_INVALID_PARAM;
727 extern int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame );
728 static vpx_codec_err_t vp8_get_last_ref_frame(vpx_codec_alg_priv_t *ctx,
731 int *ref_info = va_arg(args, int *);
733 if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads)
735 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
736 VP8_COMMON *oci = &pbi->common;
738 (vp8dx_references_buffer( oci, ALTREF_FRAME )?VP8_ALTR_FRAME:0) |
739 (vp8dx_references_buffer( oci, GOLDEN_FRAME )?VP8_GOLD_FRAME:0) |
740 (vp8dx_references_buffer( oci, LAST_FRAME )?VP8_LAST_FRAME:0);
745 return VPX_CODEC_INVALID_PARAM;
748 static vpx_codec_err_t vp8_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
752 int *corrupted = va_arg(args, int *);
753 VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
755 if (corrupted && pbi)
757 const YV12_BUFFER_CONFIG *const frame = pbi->common.frame_to_show;
758 if (frame == NULL) return VPX_CODEC_ERROR;
759 *corrupted = frame->corrupted;
763 return VPX_CODEC_INVALID_PARAM;
767 static vpx_codec_err_t vp8_set_decryptor(vpx_codec_alg_priv_t *ctx,
770 vpx_decrypt_init *init = va_arg(args, vpx_decrypt_init *);
774 ctx->decrypt_cb = init->decrypt_cb;
775 ctx->decrypt_state = init->decrypt_state;
779 ctx->decrypt_cb = NULL;
780 ctx->decrypt_state = NULL;
785 vpx_codec_ctrl_fn_map_t vp8_ctf_maps[] =
787 {VP8_SET_REFERENCE, vp8_set_reference},
788 {VP8_COPY_REFERENCE, vp8_get_reference},
789 {VP8_SET_POSTPROC, vp8_set_postproc},
790 {VP8_SET_DBG_COLOR_REF_FRAME, vp8_set_dbg_color_ref_frame},
791 {VP8_SET_DBG_COLOR_MB_MODES, vp8_set_dbg_color_mb_modes},
792 {VP8_SET_DBG_COLOR_B_MODES, vp8_set_dbg_color_b_modes},
793 {VP8_SET_DBG_DISPLAY_MV, vp8_set_dbg_display_mv},
794 {VP8D_GET_LAST_REF_UPDATES, vp8_get_last_ref_updates},
795 {VP8D_GET_FRAME_CORRUPTED, vp8_get_frame_corrupted},
796 {VP8D_GET_LAST_REF_USED, vp8_get_last_ref_frame},
797 {VPXD_SET_DECRYPTOR, vp8_set_decryptor},
802 #ifndef VERSION_STRING
803 #define VERSION_STRING
805 CODEC_INTERFACE(vpx_codec_vp8_dx) =
807 "WebM Project VP8 Decoder" VERSION_STRING,
808 VPX_CODEC_INTERNAL_ABI_VERSION,
809 VPX_CODEC_CAP_DECODER | VP8_CAP_POSTPROC | VP8_CAP_ERROR_CONCEALMENT |
810 VPX_CODEC_CAP_INPUT_FRAGMENTS,
811 /* vpx_codec_caps_t caps; */
812 vp8_init, /* vpx_codec_init_fn_t init; */
813 vp8_destroy, /* vpx_codec_destroy_fn_t destroy; */
814 vp8_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */
816 vp8_peek_si, /* vpx_codec_peek_si_fn_t peek_si; */
817 vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */
818 vp8_decode, /* vpx_codec_decode_fn_t decode; */
819 vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
822 { /* encoder functions */