OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 vpx_codec_err_t res = VPX_CODEC_OK; | 105 vpx_codec_err_t res = VPX_CODEC_OK; |
106 vpx_codec_alg_priv_t *priv = NULL; | 106 vpx_codec_alg_priv_t *priv = NULL; |
107 (void) data; | 107 (void) data; |
108 | 108 |
109 vp8_rtcd(); | 109 vp8_rtcd(); |
110 | 110 |
111 /* This function only allocates space for the vpx_codec_alg_priv_t | 111 /* This function only allocates space for the vpx_codec_alg_priv_t |
112 * structure. More memory may be required at the time the stream | 112 * structure. More memory may be required at the time the stream |
113 * information becomes known. | 113 * information becomes known. |
114 */ | 114 */ |
115 if (!ctx->priv) | 115 if (!ctx->priv) { |
116 { | 116 vp8_init_ctx(ctx); |
117 vp8_init_ctx(ctx); | 117 priv = (vpx_codec_alg_priv_t *)ctx->priv; |
118 priv = (vpx_codec_alg_priv_t *)ctx->priv; | |
119 | 118 |
120 /* initialize number of fragments to zero */ | 119 /* initialize number of fragments to zero */ |
121 priv->fragments.count = 0; | 120 priv->fragments.count = 0; |
122 /* is input fragments enabled? */ | 121 /* is input fragments enabled? */ |
123 priv->fragments.enabled = | 122 priv->fragments.enabled = |
124 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS); | 123 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS); |
125 | 124 |
126 /*post processing level initialized to do nothing */ | 125 /*post processing level initialized to do nothing */ |
127 } | 126 } else { |
128 else | 127 priv = (vpx_codec_alg_priv_t *)ctx->priv; |
129 { | |
130 priv = (vpx_codec_alg_priv_t *)ctx->priv; | |
131 } | 128 } |
132 | 129 |
133 priv->yv12_frame_buffers.use_frame_threads = | 130 priv->yv12_frame_buffers.use_frame_threads = |
134 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING); | 131 (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING); |
135 | 132 |
136 /* for now, disable frame threading */ | 133 /* for now, disable frame threading */ |
137 priv->yv12_frame_buffers.use_frame_threads = 0; | 134 priv->yv12_frame_buffers.use_frame_threads = 0; |
138 | 135 |
139 if (priv->yv12_frame_buffers.use_frame_threads && | 136 if (priv->yv12_frame_buffers.use_frame_threads && |
140 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) || | 137 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) || |
141 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) | 138 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) { |
142 { | 139 /* row-based threading, error concealment, and input fragments will |
143 /* row-based threading, error concealment, and input fragments will | 140 * not be supported when using frame-based threading */ |
144 * not be supported when using frame-based threading */ | 141 res = VPX_CODEC_INVALID_PARAM; |
145 res = VPX_CODEC_INVALID_PARAM; | |
146 } | 142 } |
147 | 143 |
148 return res; | 144 return res; |
149 } | 145 } |
150 | 146 |
151 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) | 147 static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) |
152 { | 148 { |
153 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers); | 149 vp8_remove_decoder_instances(&ctx->yv12_frame_buffers); |
154 | 150 |
155 vpx_free(ctx); | 151 vpx_free(ctx); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 { /* encoder functions */ | 817 { /* encoder functions */ |
822 0, | 818 0, |
823 NULL, | 819 NULL, |
824 NULL, | 820 NULL, |
825 NULL, | 821 NULL, |
826 NULL, | 822 NULL, |
827 NULL, | 823 NULL, |
828 NULL | 824 NULL |
829 } | 825 } |
830 }; | 826 }; |
OLD | NEW |