Commit 8a061d42 authored by clang-format's avatar clang-format Committed by James Zern

vp10/decoder,vp10/*.[hc]: apply clang-format

Change-Id: Ie4d7ecb2f692c1c43eff1242e1f00e7fbae00e57
parent 9c6a7cab
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP10_DECODER_DECODEFRAME_H_
#define VP10_DECODER_DECODEFRAME_H_
......@@ -20,13 +19,12 @@ struct VP10Decoder;
struct vpx_read_bit_buffer;
int vp10_read_sync_code(struct vpx_read_bit_buffer *const rb);
void vp10_read_frame_size(struct vpx_read_bit_buffer *rb,
int *width, int *height);
void vp10_read_frame_size(struct vpx_read_bit_buffer *rb, int *width,
int *height);
BITSTREAM_PROFILE vp10_read_profile(struct vpx_read_bit_buffer *rb);
void vp10_decode_frame(struct VP10Decoder *pbi,
const uint8_t *data, const uint8_t *data_end,
const uint8_t **p_data_end);
void vp10_decode_frame(struct VP10Decoder *pbi, const uint8_t *data,
const uint8_t *data_end, const uint8_t **p_data_end);
#ifdef __cplusplus
} // extern "C"
......
This diff is collapsed.
......@@ -24,8 +24,8 @@ void vp10_read_mode_info(VP10Decoder *const pbi, MACROBLOCKD *xd,
int supertx_enabled,
#endif
int mi_row, int mi_col, vp10_reader *r,
int x_mis, int y_mis);
int mi_row, int mi_col, vp10_reader *r, int x_mis,
int y_mis);
#ifdef __cplusplus
} // extern "C"
......
......@@ -58,12 +58,10 @@ static void vp10_dec_setup_mi(VP10_COMMON *cm) {
static int vp10_dec_alloc_mi(VP10_COMMON *cm, int mi_size) {
cm->mip = vpx_calloc(mi_size, sizeof(*cm->mip));
if (!cm->mip)
return 1;
if (!cm->mip) return 1;
cm->mi_alloc_size = mi_size;
cm->mi_grid_base = (MODE_INFO **)vpx_calloc(mi_size, sizeof(MODE_INFO*));
if (!cm->mi_grid_base)
return 1;
cm->mi_grid_base = (MODE_INFO **)vpx_calloc(mi_size, sizeof(MODE_INFO *));
if (!cm->mi_grid_base) return 1;
return 0;
}
......@@ -78,8 +76,7 @@ VP10Decoder *vp10_decoder_create(BufferPool *const pool) {
VP10Decoder *volatile const pbi = vpx_memalign(32, sizeof(*pbi));
VP10_COMMON *volatile const cm = pbi ? &pbi->common : NULL;
if (!cm)
return NULL;
if (!cm) return NULL;
vp10_zero(*pbi);
......@@ -91,11 +88,10 @@ VP10Decoder *vp10_decoder_create(BufferPool *const pool) {
cm->error.setjmp = 1;
CHECK_MEM_ERROR(cm, cm->fc,
(FRAME_CONTEXT *)vpx_calloc(1, sizeof(*cm->fc)));
CHECK_MEM_ERROR(cm, cm->frame_contexts,
(FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS,
sizeof(*cm->frame_contexts)));
CHECK_MEM_ERROR(cm, cm->fc, (FRAME_CONTEXT *)vpx_calloc(1, sizeof(*cm->fc)));
CHECK_MEM_ERROR(
cm, cm->frame_contexts,
(FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS, sizeof(*cm->frame_contexts)));
pbi->need_resync = 1;
once(initialize_dec);
......@@ -130,8 +126,7 @@ VP10Decoder *vp10_decoder_create(BufferPool *const pool) {
void vp10_decoder_remove(VP10Decoder *pbi) {
int i;
if (!pbi)
return;
if (!pbi) return;
vpx_get_worker_interface()->end(&pbi->lf_worker);
vpx_free(pbi->lf_worker.data1);
......@@ -153,13 +148,13 @@ void vp10_decoder_remove(VP10Decoder *pbi) {
static int equal_dimensions(const YV12_BUFFER_CONFIG *a,
const YV12_BUFFER_CONFIG *b) {
return a->y_height == b->y_height && a->y_width == b->y_width &&
a->uv_height == b->uv_height && a->uv_width == b->uv_width;
return a->y_height == b->y_height && a->y_width == b->y_width &&
a->uv_height == b->uv_height && a->uv_width == b->uv_width;
}
vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VP10_COMMON *cm = &pbi->common;
/* TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
......@@ -180,17 +175,15 @@ vpx_codec_err_t vp10_copy_reference_dec(VP10Decoder *pbi,
else
vpx_yv12_copy_frame(cfg, sd);
} else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame");
vpx_internal_error(&cm->error, VPX_CODEC_ERROR, "Invalid reference frame");
}
return cm->error.error_code;
}
vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
int idx;
YV12_BUFFER_CONFIG *ref_buf = NULL;
......@@ -235,8 +228,7 @@ vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
idx = cm->ref_frame_map[2];
#endif // CONFIG_EXT_REFS
} else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame");
vpx_internal_error(&cm->error, VPX_CODEC_ERROR, "Invalid reference frame");
return cm->error.error_code;
}
......@@ -275,8 +267,7 @@ static void swap_frame_buffers(VP10Decoder *pbi) {
// Release the reference frame holding in the reference map for the decoding
// of the next frame.
if (mask & 1)
decrease_ref_count(old_idx, frame_bufs, pool);
if (mask & 1) decrease_ref_count(old_idx, frame_bufs, pool);
cm->ref_frame_map[ref_index] = cm->next_ref_frame_map[ref_index];
++ref_index;
}
......@@ -307,8 +298,8 @@ static void swap_frame_buffers(VP10Decoder *pbi) {
}
}
int vp10_receive_compressed_data(VP10Decoder *pbi,
size_t size, const uint8_t **psource) {
int vp10_receive_compressed_data(VP10Decoder *pbi, size_t size,
const uint8_t **psource) {
VP10_COMMON *volatile const cm = &pbi->common;
BufferPool *volatile const pool = cm->buffer_pool;
RefCntBuffer *volatile const frame_bufs = cm->buffer_pool->frame_bufs;
......@@ -338,15 +329,14 @@ int vp10_receive_compressed_data(VP10Decoder *pbi,
// Check if the previous frame was a frame without any references to it.
// Release frame buffer if not decoding in frame parallel mode.
if (!cm->frame_parallel_decode && cm->new_fb_idx >= 0
&& frame_bufs[cm->new_fb_idx].ref_count == 0)
if (!cm->frame_parallel_decode && cm->new_fb_idx >= 0 &&
frame_bufs[cm->new_fb_idx].ref_count == 0)
pool->release_fb_cb(pool->cb_priv,
&frame_bufs[cm->new_fb_idx].raw_frame_buffer);
// Find a free frame buffer. Return error if can not find any.
cm->new_fb_idx = get_free_fb(cm);
if (cm->new_fb_idx == INVALID_IDX)
return VPX_CODEC_MEM_ERROR;
if (cm->new_fb_idx == INVALID_IDX) return VPX_CODEC_MEM_ERROR;
// Assign a MV array to the frame buffer.
cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx];
......@@ -388,10 +378,9 @@ int vp10_receive_compressed_data(VP10Decoder *pbi,
// Current thread releases the holding of reference frame.
decrease_ref_count(old_idx, frame_bufs, pool);
// Release the reference frame holding in the reference map for the
// decoding of the next frame.
if (mask & 1)
decrease_ref_count(old_idx, frame_bufs, pool);
// Release the reference frame holding in the reference map for the
// decoding of the next frame.
if (mask & 1) decrease_ref_count(old_idx, frame_bufs, pool);
++ref_index;
}
......@@ -468,14 +457,12 @@ int vp10_receive_compressed_data(VP10Decoder *pbi,
int vp10_get_raw_frame(VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd) {
VP10_COMMON *const cm = &pbi->common;
int ret = -1;
if (pbi->ready_for_new_data == 1)
return ret;
if (pbi->ready_for_new_data == 1) return ret;
pbi->ready_for_new_data = 1;
/* no raw frame to show!!! */
if (!cm->show_frame)
return ret;
if (!cm->show_frame) return ret;
pbi->ready_for_new_data = 1;
*sd = *cm->frame_to_show;
......@@ -484,22 +471,19 @@ int vp10_get_raw_frame(VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd) {
return ret;
}
int vp10_get_frame_to_show(VP10Decoder *pbi,
YV12_BUFFER_CONFIG *frame) {
int vp10_get_frame_to_show(VP10Decoder *pbi, YV12_BUFFER_CONFIG *frame) {
VP10_COMMON *const cm = &pbi->common;
if (!cm->show_frame || !cm->frame_to_show)
return -1;
if (!cm->show_frame || !cm->frame_to_show) return -1;
*frame = *cm->frame_to_show;
return 0;
}
vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data,
size_t data_sz,
uint32_t sizes[8], int *count,
vpx_decrypt_cb decrypt_cb,
void *decrypt_state) {
vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data, size_t data_sz,
uint32_t sizes[8], int *count,
vpx_decrypt_cb decrypt_cb,
void *decrypt_state) {
// A chunk ending with a byte matching 0xc0 is an invalid chunk unless
// it is a super frame index. If the last byte of real video compression
// data is 0xc0 the encoder must add a 0 byte. If we have the marker but
......@@ -520,18 +504,16 @@ vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data,
// This chunk is marked as having a superframe index but doesn't have
// enough data for it, thus it's an invalid superframe index.
if (data_sz < index_sz)
return VPX_CODEC_CORRUPT_FRAME;
if (data_sz < index_sz) return VPX_CODEC_CORRUPT_FRAME;
{
const uint8_t marker2 = read_marker(decrypt_cb, decrypt_state,
data + data_sz - index_sz);
const uint8_t marker2 =
read_marker(decrypt_cb, decrypt_state, data + data_sz - index_sz);
// This chunk is marked as having a superframe index but doesn't have
// the matching marker byte at the front of the index therefore it's an
// invalid chunk.
if (marker != marker2)
return VPX_CODEC_CORRUPT_FRAME;
if (marker != marker2) return VPX_CODEC_CORRUPT_FRAME;
}
{
......@@ -550,8 +532,7 @@ vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data,
for (i = 0; i < frames - 1; ++i) {
uint32_t this_sz = 0;
for (j = 0; j < mag; ++j)
this_sz |= (*x++) << (j * 8);
for (j = 0; j < mag; ++j) this_sz |= (*x++) << (j * 8);
this_sz += 1;
sizes[i] = this_sz;
frame_sz_sum += this_sz;
......
......@@ -52,7 +52,7 @@ typedef struct TileBufferDec {
size_t size;
const uint8_t *raw_data_end; // The end of the raw tile buffer in the
// bit stream.
int col; // only used with multi-threaded decoding
int col; // only used with multi-threaded decoding
} TileBufferDec;
typedef struct VP10Decoder {
......@@ -66,9 +66,9 @@ typedef struct VP10Decoder {
// TODO(hkuang): Combine this with cur_buf in macroblockd as they are
// the same.
RefCntBuffer *cur_buf; // Current decoding frame buffer.
RefCntBuffer *cur_buf; // Current decoding frame buffer.
VPxWorker *frame_worker_owner; // frame_worker that owns this pbi.
VPxWorker *frame_worker_owner; // frame_worker that owns this pbi.
VPxWorker lf_worker;
VPxWorker *tile_workers;
TileWorkerData *tile_worker_data;
......@@ -87,7 +87,7 @@ typedef struct VP10Decoder {
int max_threads;
int inv_tile_order;
int need_resync; // wait for key/intra-only frame.
int need_resync; // wait for key/intra-only frame.
int hold_ref_buf; // hold the reference buffer.
int tile_size_bytes;
......@@ -97,24 +97,23 @@ typedef struct VP10Decoder {
#endif // CONFIG_EXT_TILE
} VP10Decoder;
int vp10_receive_compressed_data(struct VP10Decoder *pbi,
size_t size, const uint8_t **dest);
int vp10_receive_compressed_data(struct VP10Decoder *pbi, size_t size,
const uint8_t **dest);
int vp10_get_raw_frame(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *sd);
int vp10_get_frame_to_show(struct VP10Decoder *pbi, YV12_BUFFER_CONFIG *frame);
vpx_codec_err_t vp10_copy_reference_dec(struct VP10Decoder *pbi,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp10_set_reference_dec(VP10_COMMON *cm,
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
VPX_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd);
static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb,
void *decrypt_state,
const uint8_t *data) {
void *decrypt_state, const uint8_t *data) {
if (decrypt_cb) {
uint8_t marker;
decrypt_cb(decrypt_state, data, &marker, 1);
......@@ -125,11 +124,10 @@ static INLINE uint8_t read_marker(vpx_decrypt_cb decrypt_cb,
// This function is exposed for use in tests, as well as the inlined function
// "read_marker".
vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data,
size_t data_sz,
uint32_t sizes[8], int *count,
vpx_decrypt_cb decrypt_cb,
void *decrypt_state);
vpx_codec_err_t vp10_parse_superframe_index(const uint8_t *data, size_t data_sz,
uint32_t sizes[8], int *count,
vpx_decrypt_cb decrypt_cb,
void *decrypt_state);
struct VP10Decoder *vp10_decoder_create(BufferPool *const pool);
......@@ -158,8 +156,7 @@ static INLINE int dec_is_ref_frame_buf(VP10Decoder *const pbi,
for (i = 0; i < INTER_REFS_PER_FRAME; ++i) {
RefBuffer *const ref_frame = &cm->frame_refs[i];
if (ref_frame->idx == INVALID_IDX) continue;
if (frame_buf == &cm->buffer_pool->frame_bufs[ref_frame->idx])
break;
if (frame_buf == &cm->buffer_pool->frame_bufs[ref_frame->idx]) break;
}
return (i < INTER_REFS_PER_FRAME);
}
......
This diff is collapsed.
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP10_DECODER_DETOKENIZE_H_
#define VP10_DECODER_DETOKENIZE_H_
......@@ -22,11 +21,9 @@ extern "C" {
void vp10_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
vp10_reader *r);
int vp10_decode_block_tokens(MACROBLOCKD *const xd,
int plane, const scan_order *sc,
int x, int y,
TX_SIZE tx_size,
TX_TYPE tx_type,
int vp10_decode_block_tokens(MACROBLOCKD *const xd, int plane,
const scan_order *sc, int x, int y,
TX_SIZE tx_size, TX_TYPE tx_type,
#if CONFIG_ANS
struct AnsDecoder *const r,
#else
......
......@@ -15,8 +15,7 @@
#include "vp10/decoder/dsubexp.h"
static int inv_recenter_nonneg(int v, int m) {
if (v > 2 * m)
return v;
if (v > 2 * m) return v;
return (v & 1) ? m - ((v + 1) >> 1) : m + (v >> 1);
}
......@@ -25,19 +24,19 @@ static int decode_uniform(vp10_reader *r) {
const int l = 8;
const int m = (1 << l) - 190;
const int v = vp10_read_literal(r, l - 1);
return v < m ? v : (v << 1) - m + vp10_read_bit(r);
return v < m ? v : (v << 1) - m + vp10_read_bit(r);
}
static int inv_remap_prob(int v, int m) {
static uint8_t inv_map_table[MAX_PROB - 1] = {
7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, 189,
202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92,
93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, 189,
202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76,
77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92,
93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 125,
126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141,
142, 143, 144, 145, 146, 147, 148, 149, 151, 152, 153, 154, 155, 156, 157,
......@@ -59,16 +58,13 @@ static int inv_remap_prob(int v, int m) {
}
static int decode_term_subexp(vp10_reader *r) {
if (!vp10_read_bit(r))
return vp10_read_literal(r, 4);
if (!vp10_read_bit(r))
return vp10_read_literal(r, 4) + 16;
if (!vp10_read_bit(r))
return vp10_read_literal(r, 5) + 32;
if (!vp10_read_bit(r)) return vp10_read_literal(r, 4);
if (!vp10_read_bit(r)) return vp10_read_literal(r, 4) + 16;
if (!vp10_read_bit(r)) return vp10_read_literal(r, 5) + 32;
return decode_uniform(r) + 64;
}
void vp10_diff_update_prob(vp10_reader *r, vpx_prob* p) {
void vp10_diff_update_prob(vp10_reader *r, vpx_prob *p) {
if (vp10_read(r, DIFF_UPDATE_PROB)) {
const int delp = decode_term_subexp(r);
*p = (vpx_prob)inv_remap_prob(delp, *p);
......
......@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP10_DECODER_DSUBEXP_H_
#define VP10_DECODER_DSUBEXP_H_
......@@ -18,7 +17,7 @@
extern "C" {
#endif
void vp10_diff_update_prob(vp10_reader *r, vpx_prob* p);
void vp10_diff_update_prob(vp10_reader *r, vpx_prob *p);
#ifdef __cplusplus
} // extern "C"
......
......@@ -60,10 +60,9 @@ void vp10_frameworker_signal_stats(VPxWorker *const worker) {
// TODO(hkuang): Remove worker parameter as it is only used in debug code.
void vp10_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf,
int row) {
int row) {
#if CONFIG_MULTITHREAD
if (!ref_buf)
return;
if (!ref_buf) return;
#ifndef BUILDING_WITH_TSAN
// The following line of code will get harmless tsan error but it is the key
......@@ -135,7 +134,7 @@ void vp10_frameworker_broadcast(RefCntBuffer *const buf, int row) {
}
void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
VPxWorker *const src_worker) {
VPxWorker *const src_worker) {
#if CONFIG_MULTITHREAD
FrameWorkerData *const src_worker_data = (FrameWorkerData *)src_worker->data1;
FrameWorkerData *const dst_worker_data = (FrameWorkerData *)dst_worker->data1;
......@@ -147,11 +146,12 @@ void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
vp10_frameworker_lock_stats(src_worker);
while (!src_worker_data->frame_context_ready) {
pthread_cond_wait(&src_worker_data->stats_cond,
&src_worker_data->stats_mutex);
&src_worker_data->stats_mutex);
}
dst_cm->last_frame_seg_map = src_cm->seg.enabled ?
src_cm->current_frame_seg_map : src_cm->last_frame_seg_map;
dst_cm->last_frame_seg_map = src_cm->seg.enabled
? src_cm->current_frame_seg_map
: src_cm->last_frame_seg_map;
dst_worker_data->pbi->need_resync = src_worker_data->pbi->need_resync;
vp10_frameworker_unlock_stats(src_worker);
......@@ -160,19 +160,20 @@ void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
dst_cm->use_highbitdepth = src_cm->use_highbitdepth;
#endif
#if CONFIG_EXT_REFS
// TODO(zoeliu): To handle parallel decoding
// TODO(zoeliu): To handle parallel decoding
#endif // CONFIG_EXT_REFS
dst_cm->prev_frame = src_cm->show_existing_frame ?
src_cm->prev_frame : src_cm->cur_frame;
dst_cm->last_width = !src_cm->show_existing_frame ?
src_cm->width : src_cm->last_width;
dst_cm->last_height = !src_cm->show_existing_frame ?
src_cm->height : src_cm->last_height;
dst_cm->prev_frame =
src_cm->show_existing_frame ? src_cm->prev_frame : src_cm->cur_frame;
dst_cm->last_width =
!src_cm->show_existing_frame ? src_cm->width : src_cm->last_width;
dst_cm->last_height =
!src_cm->show_existing_frame ? src_cm->height : src_cm->last_height;
dst_cm->subsampling_x = src_cm->subsampling_x;
dst_cm->subsampling_y = src_cm->subsampling_y;
dst_cm->frame_type = src_cm->frame_type;
dst_cm->last_show_frame = !src_cm->show_existing_frame ?
src_cm->show_frame : src_cm->last_show_frame;
dst_cm->last_show_frame = !src_cm->show_existing_frame
? src_cm->show_frame
: src_cm->last_show_frame;
for (i = 0; i < REF_FRAMES; ++i)
dst_cm->ref_frame_map[i] = src_cm->next_ref_frame_map[i];
......@@ -186,7 +187,7 @@ void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
memcpy(dst_cm->frame_contexts, src_cm->frame_contexts,
FRAME_CONTEXTS * sizeof(dst_cm->frame_contexts[0]));
#else
(void) dst_worker;
(void) src_worker;
(void)dst_worker;
(void)src_worker;
#endif // CONFIG_MULTITHREAD
}
......@@ -57,7 +57,7 @@ void vp10_frameworker_signal_stats(VPxWorker *const worker);
// start decoding next frame. So need to check whether worker is still decoding
// ref_buf.
void vp10_frameworker_wait(VPxWorker *const worker, RefCntBuffer *const ref_buf,
int row);
int row);
// FrameWorker broadcasts its decoding progress so other workers that are
// waiting on it can resume decoding.
......@@ -65,10 +65,10 @@ void vp10_frameworker_broadcast(RefCntBuffer *const buf, int row);
// Copy necessary decoding context from src worker to dst worker.
void vp10_frameworker_copy_context(VPxWorker *const dst_worker,
VPxWorker *const src_worker);
VPxWorker *const src_worker);
#ifdef __cplusplus
} // extern "C"
} // extern "C"
#endif
#endif // VP10_DECODER_DTHREAD_H_
This diff is collapsed.
This diff is collapsed.
......@@ -12,7 +12,7 @@
#include "vpx_ports/mem.h"
static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
void *user_priv) {
/** vpx_img_wrap() doesn't allow specifying independent strides for
* the Y, U, and V planes, nor other alignment adjustments that
......@@ -61,9 +61,9 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
// of the image.
img->fmt = (vpx_img_fmt_t)(img->fmt | VPX_IMG_FMT_HIGHBITDEPTH);
img->bit_depth = yv12->bit_depth;
img->planes[VPX_PLANE_Y] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->y_buffer);
img->planes[VPX_PLANE_U] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->u_buffer);
img->planes[VPX_PLANE_V] = (uint8_t*)CONVERT_TO_SHORTPTR(yv12->v_buffer);
img->planes[VPX_PLANE_Y] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->y_buffer);
img->planes[VPX_PLANE_U] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->u_buffer);
img->planes[VPX_PLANE_V] = (uint8_t *)CONVERT_TO_SHORTPTR(yv12->v_buffer);
img->planes[VPX_PLANE_ALPHA] = NULL;
img->stride[VPX_PLANE_Y] = 2 * yv12->y_stride;
img->stride[VPX_PLANE_U] = 2 * yv12->uv_stride;
......@@ -84,17 +84,17 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
yv12->u_buffer = img->planes[VPX_PLANE_U];
yv12->v_buffer = img->planes[VPX_PLANE_V];
yv12->y_crop_width = img->d_w;
yv12->y_crop_width = img->d_w;
yv12->y_crop_height = img->d_h;
yv12->render_width = img->r_w;
yv12->render_width = img->r_w;
yv12->render_height = img->r_h;
yv12->y_width = img->d_w;
yv12->y_width = img->d_w;
yv12->y_height = img->d_h;
yv12->uv_width = img->x_chroma_shift == 1 ? (1 + yv12->y_width) / 2
: yv12->y_width;
yv12->uv_height = img->y_chroma_shift == 1 ? (1 + yv12->y_height) / 2
: yv12->y_height;
yv12->uv_width =
img->x_chroma_shift == 1 ? (1 + yv12->y_width) / 2 : yv12->y_width;
yv12->uv_height =
img->y_chroma_shift == 1 ? (1 + yv12->y_height) / 2 : yv12->y_height;
yv12->uv_crop_width = yv12->uv_width;
yv12->uv_crop_height = yv12->uv_height;
......@@ -124,9 +124,9 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
} else {
yv12->flags = 0;
}
yv12->border = (yv12->y_stride - img->w) / 2;
yv12->border = (yv12->y_stride - img->w) / 2;
#else
yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2;
yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2;
#endif // CONFIG_VP9_HIGHBITDEPTH
yv12->subsampling_x = img->x_chroma_shift;
yv12->subsampling_y = img->y_chroma_shift;
......@@ -135,12 +135,9 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
static VPX_REFFRAME ref_frame_to_vp10_reframe(vpx_ref_frame_type_t frame) {
switch (frame) {
case VP8_LAST_FRAME:
return VPX_LAST_FLAG;
case VP8_GOLD_FRAME:
return VPX_GOLD_FLAG;
case VP8_ALTR_FRAME:
return VPX_ALT_FLAG;
case VP8_LAST_FRAME: return VPX_LAST_FLAG;
case VP8_GOLD_FRAME: return VPX_GOLD_FLAG;
case VP8_ALTR_FRAME: return VPX_ALT_FLAG;
}
assert(0 && "Invalid Reference Frame");
return VPX_LAST_FLAG;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment