Revision d375c104 libavcodec/mdec.c
libavcodec/mdec.c | ||
---|---|---|
31 | 31 |
#include "dsputil.h" |
32 | 32 |
#include "mpegvideo.h" |
33 | 33 |
#include "mpeg12.h" |
34 |
#include "thread.h" |
|
34 | 35 |
|
35 | 36 |
typedef struct MDECContext{ |
36 | 37 |
AVCodecContext *avctx; |
... | ... | |
162 | 163 |
int i; |
163 | 164 |
|
164 | 165 |
if(p->data[0]) |
165 |
avctx->release_buffer(avctx, p);
|
|
166 |
ff_thread_release_buffer(avctx, p);
|
|
166 | 167 |
|
167 | 168 |
p->reference= 0; |
168 |
if(avctx->get_buffer(avctx, p) < 0){
|
|
169 |
if(ff_thread_get_buffer(avctx, p) < 0){
|
|
169 | 170 |
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
170 | 171 |
return -1; |
171 | 172 |
} |
... | ... | |
238 | 239 |
return 0; |
239 | 240 |
} |
240 | 241 |
|
242 |
static av_cold int decode_init_thread_copy(AVCodecContext *avctx){ |
|
243 |
MDECContext * const a = avctx->priv_data; |
|
244 |
AVFrame *p = (AVFrame*)&a->picture; |
|
245 |
|
|
246 |
avctx->coded_frame= p; |
|
247 |
a->avctx= avctx; |
|
248 |
|
|
249 |
p->qscale_table= av_mallocz( p->qstride * a->mb_height); |
|
250 |
|
|
251 |
return 0; |
|
252 |
} |
|
253 |
|
|
241 | 254 |
static av_cold int decode_end(AVCodecContext *avctx){ |
242 | 255 |
MDECContext * const a = avctx->priv_data; |
243 | 256 |
|
... | ... | |
259 | 272 |
NULL, |
260 | 273 |
decode_end, |
261 | 274 |
decode_frame, |
262 |
CODEC_CAP_DR1, |
|
275 |
CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
|
|
263 | 276 |
.long_name= NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"), |
277 |
.init_thread_copy= ONLY_IF_THREADS_ENABLED(decode_init_thread_copy) |
|
264 | 278 |
}; |
265 | 279 |
|
Also available in: Unified diff