History

vp9_dx_iface: move struct defs to separate header

this avoids redefining vpx_codec_vp9_dx, vpx_codec_vp9_dx_algo in vp9_encoder_parms_get_to_decoder.cc

James Zern committed 11 years ago

Commit bc98bf61 parent 8f9c9ab4 files · +68 −53Browse files

Unified · Split

4 files
  1. test/vp9_encoder_parms_get_to_decoder.cc +1 −3
  2. vp9/vp9_dx_iface.c +1 −50
  3. vp9/vp9_dx_iface.h +65 −0
  4. vp9/vp9dx.mk +1 −0
test/vp9_encoder_parms_get_to_decoder.cc+1−3
@@ -14,9 +14,7 @@ · 13 unmodified lines
1414 #include "test/encode_test_driver.h"
1515 #include "test/util.h"
1616 #include "test/y4m_video_source.h"
17−#include "vp9/decoder/vp9_decoder.h"
18−
19−#include "vp9/vp9_dx_iface.c"
17+#include "vp9/vp9_dx_iface.h"
2018
2119 namespace {
2220
vp9/vp9_dx_iface.c+1−50
@@ -24,62 +24,13 @@ · 23 unmodified lines
2424 #include "vp9/common/vp9_alloccommon.h"
2525 #include "vp9/common/vp9_frame_buffers.h"
2626
27−#include "vp9/decoder/vp9_decoder.h"
2827 #include "vp9/decoder/vp9_decodeframe.h"
2928
29+#include "vp9/vp9_dx_iface.h"
3030 #include "vp9/vp9_iface_common.h"
3131
3232 #define VP9_CAP_POSTPROC (CONFIG_VP9_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0)
3333
34−typedef vpx_codec_stream_info_t vp9_stream_info_t;
35−
36−// This limit is due to framebuffer numbers.
37−// TODO(hkuang): Remove this limit after implementing ondemand framebuffers.
38−#define FRAME_CACHE_SIZE 6 // Cache maximum 6 decoded frames.
39−
40−typedef struct cache_frame {
41− int fb_idx;
42− vpx_image_t img;
43−} cache_frame;
44−
45−struct vpx_codec_alg_priv {
46− vpx_codec_priv_t base;
47− vpx_codec_dec_cfg_t cfg;
48− vp9_stream_info_t si;
49− int postproc_cfg_set;
50− vp8_postproc_cfg_t postproc_cfg;
51− vpx_decrypt_cb decrypt_cb;
52− void *decrypt_state;
53− vpx_image_t img;
54− int img_avail;
55− int flushed;
56− int invert_tile_order;
57− int last_show_frame; // Index of last output frame.
58− int byte_alignment;
59− int skip_loop_filter;
60−
61− // Frame parallel related.
62− int frame_parallel_decode; // frame-based threading.
63− VPxWorker *frame_workers;
64− int num_frame_workers;
65− int next_submit_worker_id;
66− int last_submit_worker_id;
67− int next_output_worker_id;
68− int available_threads;
69− cache_frame frame_cache[FRAME_CACHE_SIZE];
70− int frame_cache_write;
71− int frame_cache_read;
72− int num_cache_frames;
73− int need_resync; // wait for key/intra-only frame
74− // BufferPool that holds all reference frames. Shared by all the FrameWorkers.
75− BufferPool *buffer_pool;
76−
77− // External frame buffer info to save for VP9 common.
78− void *ext_priv; // Private data associated with the external frame buffers.
79− vpx_get_frame_buffer_cb_fn_t get_ext_fb_cb;
80− vpx_release_frame_buffer_cb_fn_t release_ext_fb_cb;
81−};
82−
8334 static vpx_codec_err_t decoder_init(vpx_codec_ctx_t *ctx,
8435 vpx_codec_priv_enc_mr_cfg_t *data) {
8536 // This function only allocates space for the vpx_codec_alg_priv_t
vp9/vp9_dx_iface.h+65−0
@@ -0,0 +1,65 @@
1+/*
2+ * Copyright (c) 2015 The WebM project authors. All Rights Reserved.
3+ *
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.
9+ */
10+
11+#ifndef VP9_VP9_DX_IFACE_H_
12+#define VP9_VP9_DX_IFACE_H_
13+
14+#include "vp9/decoder/vp9_decoder.h"
15+
16+typedef vpx_codec_stream_info_t vp9_stream_info_t;
17+
18+// This limit is due to framebuffer numbers.
19+// TODO(hkuang): Remove this limit after implementing ondemand framebuffers.
20+#define FRAME_CACHE_SIZE 6 // Cache maximum 6 decoded frames.
21+
22+typedef struct cache_frame {
23+ int fb_idx;
24+ vpx_image_t img;
25+} cache_frame;
26+
27+struct vpx_codec_alg_priv {
28+ vpx_codec_priv_t base;
29+ vpx_codec_dec_cfg_t cfg;
30+ vp9_stream_info_t si;
31+ int postproc_cfg_set;
32+ vp8_postproc_cfg_t postproc_cfg;
33+ vpx_decrypt_cb decrypt_cb;
34+ void *decrypt_state;
35+ vpx_image_t img;
36+ int img_avail;
37+ int flushed;
38+ int invert_tile_order;
39+ int last_show_frame; // Index of last output frame.
40+ int byte_alignment;
41+ int skip_loop_filter;
42+
43+ // Frame parallel related.
44+ int frame_parallel_decode; // frame-based threading.
45+ VPxWorker *frame_workers;
46+ int num_frame_workers;
47+ int next_submit_worker_id;
48+ int last_submit_worker_id;
49+ int next_output_worker_id;
50+ int available_threads;
51+ cache_frame frame_cache[FRAME_CACHE_SIZE];
52+ int frame_cache_write;
53+ int frame_cache_read;
54+ int num_cache_frames;
55+ int need_resync; // wait for key/intra-only frame
56+ // BufferPool that holds all reference frames. Shared by all the FrameWorkers.
57+ BufferPool *buffer_pool;
58+
59+ // External frame buffer info to save for VP9 common.
60+ void *ext_priv; // Private data associated with the external frame buffers.
61+ vpx_get_frame_buffer_cb_fn_t get_ext_fb_cb;
62+ vpx_release_frame_buffer_cb_fn_t release_ext_fb_cb;
63+};
64+
65+#endif // VP9_VP9_DX_IFACE_H_
vp9/vp9dx.mk+1−0
@@ -16,6 +16,7 @@ VP9_DX_SRCS_REMOVE-yes += $(VP9_COMMON_SRCS_REMOVE-yes) · 15 unmodified lines
1616 VP9_DX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no)
1717
1818 VP9_DX_SRCS-yes += vp9_dx_iface.c
19+VP9_DX_SRCS-yes += vp9_dx_iface.h
1920
2021 VP9_DX_SRCS-yes += decoder/vp9_decodemv.c
2122 VP9_DX_SRCS-yes += decoder/vp9_decodeframe.c

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t