ref: 3c00132181fb945dcea2b0fc2ce5e9c5325618b5
parent: da14d23e449ceec6e804b5942df93b06a9924d6b
parent: f38616e1a21a64617c790f26a638097ff0e5ad3d
author: James Zern <jzern@google.com>
date: Fri Sep 30 21:35:55 EDT 2016
Merge "vp8,frame_buffers: remove unused use_frame_threads"
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -439,47 +439,35 @@
}
int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf) {
- if (!fb->use_frame_threads) {
- /* decoder instance for single thread mode */
- fb->pbi[0] = create_decompressor(oxcf);
- if (!fb->pbi[0]) return VPX_CODEC_ERROR;
+ /* decoder instance for single thread mode */
+ fb->pbi[0] = create_decompressor(oxcf);
+ if (!fb->pbi[0]) return VPX_CODEC_ERROR;
#if CONFIG_MULTITHREAD
- if (setjmp(fb->pbi[0]->common.error.jmp)) {
- vp8_remove_decoder_instances(fb);
- memset(fb->pbi, 0, sizeof(fb->pbi) / sizeof(fb->pbi[0]));
- vpx_clear_system_state();
- return VPX_CODEC_ERROR;
- }
-
- fb->pbi[0]->common.error.setjmp = 1;
- fb->pbi[0]->max_threads = oxcf->max_threads;
- vp8_decoder_create_threads(fb->pbi[0]);
- fb->pbi[0]->common.error.setjmp = 0;
-#endif
- } else {
- /* TODO : create frame threads and decoder instances for each
- * thread here */
+ if (setjmp(fb->pbi[0]->common.error.jmp)) {
+ vp8_remove_decoder_instances(fb);
+ memset(fb->pbi, 0, sizeof(fb->pbi) / sizeof(fb->pbi[0]));
+ vpx_clear_system_state();
+ return VPX_CODEC_ERROR;
}
+ fb->pbi[0]->common.error.setjmp = 1;
+ fb->pbi[0]->max_threads = oxcf->max_threads;
+ vp8_decoder_create_threads(fb->pbi[0]);
+ fb->pbi[0]->common.error.setjmp = 0;
+#endif
return VPX_CODEC_OK;
}
int vp8_remove_decoder_instances(struct frame_buffers *fb) {
- if (!fb->use_frame_threads) {
- VP8D_COMP *pbi = fb->pbi[0];
+ VP8D_COMP *pbi = fb->pbi[0];
- if (!pbi) return VPX_CODEC_ERROR;
+ if (!pbi) return VPX_CODEC_ERROR;
#if CONFIG_MULTITHREAD
- vp8_decoder_remove_threads(pbi);
+ vp8_decoder_remove_threads(pbi);
#endif
- /* decoder instance for single thread mode */
- remove_decompressor(pbi);
- } else {
- /* TODO : remove frame threads and decoder instances for each
- * thread here */
- }
-
+ /* decoder instance for single thread mode */
+ remove_decompressor(pbi);
return VPX_CODEC_OK;
}
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -47,9 +47,6 @@
* this struct will be populated with frame buffer management
* info in future commits. */
- /* enable/disable frame-based threading */
- int use_frame_threads;
-
/* decoder instances */
struct VP8D_COMP *pbi[MAX_FB_MT_DEC];
};
--- a/vp8/vp8_dx_iface.c
+++ b/vp8/vp8_dx_iface.c
@@ -106,20 +106,6 @@
priv = (vpx_codec_alg_priv_t *)ctx->priv;
}
- priv->yv12_frame_buffers.use_frame_threads =
- (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING);
-
- /* for now, disable frame threading */
- priv->yv12_frame_buffers.use_frame_threads = 0;
-
- if (priv->yv12_frame_buffers.use_frame_threads &&
- ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
- (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
- /* row-based threading, error concealment, and input fragments will
- * not be supported when using frame-based threading */
- res = VPX_CODEC_INVALID_PARAM;
- }
-
return res;
}
@@ -519,7 +505,7 @@
va_list args) {
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
- if (data && !ctx->yv12_frame_buffers.use_frame_threads) {
+ if (data) {
vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
YV12_BUFFER_CONFIG sd;
@@ -536,7 +522,7 @@
va_list args) {
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
- if (data && !ctx->yv12_frame_buffers.use_frame_threads) {
+ if (data) {
vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
YV12_BUFFER_CONFIG sd;
@@ -573,7 +559,7 @@
va_list args) {
int *update_info = va_arg(args, int *);
- if (update_info && !ctx->yv12_frame_buffers.use_frame_threads) {
+ if (update_info) {
VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
*update_info = pbi->common.refresh_alt_ref_frame * (int)VP8_ALTR_FRAME +
@@ -591,7 +577,7 @@
va_list args) {
int *ref_info = va_arg(args, int *);
- if (ref_info && !ctx->yv12_frame_buffers.use_frame_threads) {
+ if (ref_info) {
VP8D_COMP *pbi = (VP8D_COMP *)ctx->yv12_frame_buffers.pbi[0];
VP8_COMMON *oci = &pbi->common;
*ref_info =