Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
76d8846c
Commit
76d8846c
authored
Feb 17, 2011
by
Alexander Strange
Committed by
Ronald S. Bultje
Mar 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
huffyuv: Add multithreading support
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
ad9791e1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
huffyuv.c
libavcodec/huffyuv.c
+29
-4
No files found.
libavcodec/huffyuv.c
View file @
76d8846c
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "get_bits.h"
#include "get_bits.h"
#include "put_bits.h"
#include "put_bits.h"
#include "dsputil.h"
#include "dsputil.h"
#include "thread.h"
#define VLC_BITS 11
#define VLC_BITS 11
...
@@ -527,6 +528,28 @@ s->bgr32=1;
...
@@ -527,6 +528,28 @@ s->bgr32=1;
return
0
;
return
0
;
}
}
static
av_cold
int
decode_init_thread_copy
(
AVCodecContext
*
avctx
)
{
HYuvContext
*
s
=
avctx
->
priv_data
;
int
i
;
avctx
->
coded_frame
=
&
s
->
picture
;
alloc_temp
(
s
);
for
(
i
=
0
;
i
<
6
;
i
++
)
s
->
vlc
[
i
].
table
=
NULL
;
if
(
s
->
version
==
2
){
if
(
read_huffman_tables
(
s
,
((
uint8_t
*
)
avctx
->
extradata
)
+
4
,
avctx
->
extradata_size
)
<
0
)
return
-
1
;
}
else
{
if
(
read_old_huffman_tables
(
s
)
<
0
)
return
-
1
;
}
return
0
;
}
#endif
/* CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER */
#endif
/* CONFIG_HUFFYUV_DECODER || CONFIG_FFVHUFF_DECODER */
#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER
#if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER
...
@@ -950,10 +973,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
...
@@ -950,10 +973,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
s
->
dsp
.
bswap_buf
((
uint32_t
*
)
s
->
bitstream_buffer
,
(
const
uint32_t
*
)
buf
,
buf_size
/
4
);
s
->
dsp
.
bswap_buf
((
uint32_t
*
)
s
->
bitstream_buffer
,
(
const
uint32_t
*
)
buf
,
buf_size
/
4
);
if
(
p
->
data
[
0
])
if
(
p
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
p
);
ff_thread_
release_buffer
(
avctx
,
p
);
p
->
reference
=
0
;
p
->
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
p
)
<
0
){
if
(
ff_thread_
get_buffer
(
avctx
,
p
)
<
0
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1425,8 +1448,9 @@ AVCodec ff_huffyuv_decoder = {
...
@@ -1425,8 +1448,9 @@ AVCodec ff_huffyuv_decoder = {
NULL
,
NULL
,
decode_end
,
decode_end
,
decode_frame
,
decode_frame
,
CODEC_CAP_DR1
|
CODEC_CAP_DRAW_HORIZ_BAND
,
CODEC_CAP_DR1
|
CODEC_CAP_DRAW_HORIZ_BAND
|
CODEC_CAP_FRAME_THREADS
,
NULL
,
NULL
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
decode_init_thread_copy
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Huffyuv / HuffYUV"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Huffyuv / HuffYUV"
),
};
};
#endif
#endif
...
@@ -1441,8 +1465,9 @@ AVCodec ff_ffvhuff_decoder = {
...
@@ -1441,8 +1465,9 @@ AVCodec ff_ffvhuff_decoder = {
NULL
,
NULL
,
decode_end
,
decode_end
,
decode_frame
,
decode_frame
,
CODEC_CAP_DR1
|
CODEC_CAP_DRAW_HORIZ_BAND
,
CODEC_CAP_DR1
|
CODEC_CAP_DRAW_HORIZ_BAND
|
CODEC_CAP_FRAME_THREADS
,
NULL
,
NULL
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
decode_init_thread_copy
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Huffyuv FFmpeg variant"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Huffyuv FFmpeg variant"
),
};
};
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment