vpx/vp9/decoder/vp9_onyxd.h

68 lines
2.0 KiB
C
Raw Normal View History

2010-05-18 17:58:33 +02:00
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
2010-05-18 17:58:33 +02:00
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
2010-05-18 17:58:33 +02:00
*/
#ifndef VP9_COMMON_VP9_ONYXD_H_
#define VP9_COMMON_VP9_ONYXD_H_
2010-05-18 17:58:33 +02:00
/* Create/destroy static data structures. */
#ifdef __cplusplus
extern "C" {
2010-05-18 17:58:33 +02:00
#endif
#include "vpx_scale/yv12config.h"
#include "vp9/common/vp9_ppflags.h"
2010-05-18 17:58:33 +02:00
#include "vpx_ports/mem.h"
#include "vpx/vpx_codec.h"
2010-05-18 17:58:33 +02:00
typedef void *VP9D_PTR;
typedef struct {
int Width;
int Height;
int Version;
int postprocess;
int max_threads;
[WIP] Add column-based tiling. This patch adds column-based tiling. The idea is to make each tile independently decodable (after reading the common frame header) and also independendly encodable (minus within-frame cost adjustments in the RD loop) to speed-up hardware & software en/decoders if they used multi-threading. Column-based tiling has the added advantage (over other tiling methods) that it minimizes realtime use-case latency, since all threads can start encoding data as soon as the first SB-row worth of data is available to the encoder. There is some test code that does random tile ordering in the decoder, to confirm that each tile is indeed independently decodable from other tiles in the same frame. At tile edges, all contexts assume default values (i.e. 0, 0 motion vector, no coefficients, DC intra4x4 mode), and motion vector search and ordering do not cross tiles in the same frame. t log Tile independence is not maintained between frames ATM, i.e. tile 0 of frame 1 is free to use motion vectors that point into any tile of frame 0. We support 1 (i.e. no tiling), 2 or 4 column-tiles. The loopfilter crosses tile boundaries. I discussed this briefly with Aki and he says that's OK. An in-loop loopfilter would need to do some sync between tile threads, but that shouldn't be a big issue. Resuls: with tiling disabled, we go up slightly because of improved edge use in the intra4x4 prediction. With 2 tiles, we lose about ~1% on derf, ~0.35% on HD and ~0.55% on STD/HD. With 4 tiles, we lose another ~1.5% on derf ~0.77% on HD and ~0.85% on STD/HD. Most of this loss is concentrated in the low-bitrate end of clips, and most of it is because of the loss of edges at tile boundaries and the resulting loss of intra predictors. TODO: - more tiles (perhaps allow row-based tiling also, and max. 8 tiles)? - maybe optionally (for EC purposes), motion vectors themselves should not cross tile edges, or we should emulate such borders as if they were off-frame, to limit error propagation to within one tile only. This doesn't have to be the default behaviour but could be an optional bitstream flag. Change-Id: I5951c3a0742a767b20bc9fb5af685d9892c2c96f
2013-02-01 18:35:28 +01:00
int inv_tile_order;
int input_partition;
} VP9D_CONFIG;
typedef enum {
VP9_LAST_FLAG = 1,
VP9_GOLD_FLAG = 2,
VP9_ALT_FLAG = 4
} VP9_REFFRAME;
void vp9_initialize_dec(void);
int vp9_receive_compressed_data(VP9D_PTR comp, unsigned long size,
const unsigned char **dest,
int64_t time_stamp);
int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
int64_t *time_stamp, int64_t *time_end_stamp,
vp9_ppflags_t *flags);
vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
void vp9_remove_decompressor(VP9D_PTR comp);
2010-05-18 17:58:33 +02:00
#ifdef __cplusplus
}
#endif
#endif // VP9_COMMON_VP9_ONYXD_H_