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
e28bd75f
Commit
e28bd75f
authored
Mar 22, 2017
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/hevc: use atomics for wpp_err
parent
38d7cc22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
hevc.c
libavcodec/hevc.c
+6
-5
hevc.h
libavcodec/hevc.h
+3
-1
No files found.
libavcodec/hevc.c
View file @
e28bd75f
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include "libavutil/atomic.h"
#include "libavutil/attributes.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/common.h"
#include "libavutil/display.h"
#include "libavutil/display.h"
...
@@ -2406,7 +2405,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
...
@@ -2406,7 +2405,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
ff_thread_await_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
ff_thread_await_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
if
(
a
vpriv_atomic_int_get
(
&
s1
->
wpp_err
))
{
if
(
a
tomic_load
(
&
s1
->
wpp_err
))
{
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
return
0
;
return
0
;
}
}
...
@@ -2417,7 +2416,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
...
@@ -2417,7 +2416,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
if
(
more_data
<
0
)
{
if
(
more_data
<
0
)
{
s
->
tab_slice_address
[
ctb_addr_rs
]
=
-
1
;
s
->
tab_slice_address
[
ctb_addr_rs
]
=
-
1
;
a
vpriv_atomic_int_set
(
&
s1
->
wpp_err
,
1
);
a
tomic_store
(
&
s1
->
wpp_err
,
1
);
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
return
more_data
;
return
more_data
;
}
}
...
@@ -2429,7 +2428,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
...
@@ -2429,7 +2428,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
ff_hevc_hls_filters
(
s
,
x_ctb
,
y_ctb
,
ctb_size
);
ff_hevc_hls_filters
(
s
,
x_ctb
,
y_ctb
,
ctb_size
);
if
(
!
more_data
&&
(
x_ctb
+
ctb_size
)
<
s
->
ps
.
sps
->
width
&&
ctb_row
!=
s
->
sh
.
num_entry_point_offsets
)
{
if
(
!
more_data
&&
(
x_ctb
+
ctb_size
)
<
s
->
ps
.
sps
->
width
&&
ctb_row
!=
s
->
sh
.
num_entry_point_offsets
)
{
a
vpriv_atomic_int_set
(
&
s1
->
wpp_err
,
1
);
a
tomic_store
(
&
s1
->
wpp_err
,
1
);
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
ff_thread_report_progress2
(
s
->
avctx
,
ctb_row
,
thread
,
SHIFT_CTB_WPP
);
return
0
;
return
0
;
}
}
...
@@ -2530,7 +2529,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal)
...
@@ -2530,7 +2529,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal)
s
->
sList
[
i
]
->
HEVClc
=
s
->
HEVClcList
[
i
];
s
->
sList
[
i
]
->
HEVClc
=
s
->
HEVClcList
[
i
];
}
}
a
vpriv_atomic_int_set
(
&
s
->
wpp_err
,
0
);
a
tomic_store
(
&
s
->
wpp_err
,
0
);
ff_reset_entries
(
s
->
avctx
);
ff_reset_entries
(
s
->
avctx
);
for
(
i
=
0
;
i
<=
s
->
sh
.
num_entry_point_offsets
;
i
++
)
{
for
(
i
=
0
;
i
<=
s
->
sh
.
num_entry_point_offsets
;
i
++
)
{
...
@@ -3340,6 +3339,8 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
...
@@ -3340,6 +3339,8 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
s
->
picture_struct
=
0
;
s
->
picture_struct
=
0
;
s
->
eos
=
1
;
s
->
eos
=
1
;
atomic_init
(
&
s
->
wpp_err
,
0
);
if
(
avctx
->
active_thread_type
&
FF_THREAD_SLICE
)
if
(
avctx
->
active_thread_type
&
FF_THREAD_SLICE
)
s
->
threads_number
=
avctx
->
thread_count
;
s
->
threads_number
=
avctx
->
thread_count
;
else
else
...
...
libavcodec/hevc.h
View file @
e28bd75f
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#ifndef AVCODEC_HEVC_H
#ifndef AVCODEC_HEVC_H
#define AVCODEC_HEVC_H
#define AVCODEC_HEVC_H
#include <stdatomic.h>
#include "libavutil/buffer.h"
#include "libavutil/buffer.h"
#include "libavutil/md5.h"
#include "libavutil/md5.h"
...
@@ -885,7 +887,7 @@ typedef struct HEVCContext {
...
@@ -885,7 +887,7 @@ typedef struct HEVCContext {
uint16_t
seq_output
;
uint16_t
seq_output
;
int
enable_parallel_tiles
;
int
enable_parallel_tiles
;
int
wpp_err
;
atomic_
int
wpp_err
;
const
uint8_t
*
data
;
const
uint8_t
*
data
;
...
...
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