History

avcodec/vble: add frame threading support

Paul B Mahol committed 10 years ago

Commit d93495c1 parent 89e93931 file · +5 −2Browse files

Unified · Split

libavcodec/vble.c+5−2
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include "huffyuvdsp.h"
3434 #include "internal.h"
3535 #include "mathops.h"
36+#include "thread.h"
3637
3738 typedef struct VBLEContext {
3839 AVCodecContext *avctx;
@@ -125,6 +126,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, · 86 unmodified lines
125126 int offset = 0;
126127 int width_uv = avctx->width / 2, height_uv = avctx->height / 2;
127128 int ret;
129+ ThreadFrame frame = { .f = data };
128130
129131 if (avpkt->size < 4 || avpkt->size - 4 > INT_MAX/8) {
130132 av_log(avctx, AV_LOG_ERROR, "Invalid packet size\n");
@@ -132,7 +134,7 @@ static int vble_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, · 1 unmodified line
132134 }
133135
134136 /* Allocate buffer */
135− if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
137+ if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
136138 return ret;
137139
138140 /* Set flags */
@@ -212,5 +214,6 @@ AVCodec ff_vble_decoder = { · 73 unmodified lines
212214 .init = vble_decode_init,
213215 .close = vble_decode_close,
214216 .decode = vble_decode_frame,
215− .capabilities = AV_CODEC_CAP_DR1,
217+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
218+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(vble_decode_init),
216219 };

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