Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
5c3fa74b
Commit
5c3fa74b
authored
Dec 14, 2013
by
Mickaël Raulet
Committed by
Anton Khirnov
Dec 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: support luma bit depth != chroma bit depth for PCM coding units
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
78d0b7f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
14 deletions
+5
-14
hevc.c
libavcodec/hevc.c
+3
-3
hevc.h
libavcodec/hevc.h
+1
-0
hevc_ps.c
libavcodec/hevc_ps.c
+1
-11
No files found.
libavcodec/hevc.c
View file @
5c3fa74b
...
...
@@ -1420,7 +1420,7 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
int
stride2
=
s
->
frame
->
linesize
[
2
];
uint8_t
*
dst2
=
&
s
->
frame
->
data
[
2
][(
y0
>>
s
->
sps
->
vshift
[
2
])
*
stride2
+
((
x0
>>
s
->
sps
->
hshift
[
2
])
<<
s
->
sps
->
pixel_shift
)];
int
length
=
cb_size
*
cb_size
*
s
->
sps
->
pcm
.
bit_depth
+
((
cb_size
*
cb_size
)
>>
1
)
*
s
->
sps
->
pcm
.
bit_depth
;
int
length
=
cb_size
*
cb_size
*
s
->
sps
->
pcm
.
bit_depth
+
((
cb_size
*
cb_size
)
>>
1
)
*
s
->
sps
->
pcm
.
bit_depth
_chroma
;
const
uint8_t
*
pcm
=
skip_bytes
(
&
s
->
HEVClc
.
cc
,
(
length
+
7
)
>>
3
);
int
ret
;
...
...
@@ -1433,8 +1433,8 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size)
return
ret
;
s
->
hevcdsp
.
put_pcm
(
dst0
,
stride0
,
cb_size
,
&
gb
,
s
->
sps
->
pcm
.
bit_depth
);
s
->
hevcdsp
.
put_pcm
(
dst1
,
stride1
,
cb_size
/
2
,
&
gb
,
s
->
sps
->
pcm
.
bit_depth
);
s
->
hevcdsp
.
put_pcm
(
dst2
,
stride2
,
cb_size
/
2
,
&
gb
,
s
->
sps
->
pcm
.
bit_depth
);
s
->
hevcdsp
.
put_pcm
(
dst1
,
stride1
,
cb_size
/
2
,
&
gb
,
s
->
sps
->
pcm
.
bit_depth
_chroma
);
s
->
hevcdsp
.
put_pcm
(
dst2
,
stride2
,
cb_size
/
2
,
&
gb
,
s
->
sps
->
pcm
.
bit_depth
_chroma
);
return
0
;
}
...
...
libavcodec/hevc.h
View file @
5c3fa74b
...
...
@@ -419,6 +419,7 @@ typedef struct HEVCSPS {
struct
{
uint8_t
bit_depth
;
uint8_t
bit_depth_chroma
;
unsigned
int
log2_min_pcm_cb_size
;
unsigned
int
log2_max_pcm_cb_size
;
uint8_t
loop_filter_disable_flag
;
...
...
libavcodec/hevc_ps.c
View file @
5c3fa74b
...
...
@@ -799,18 +799,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps
->
pcm_enabled_flag
=
get_bits1
(
gb
);
if
(
sps
->
pcm_enabled_flag
)
{
int
pcm_bit_depth_chroma
;
sps
->
pcm
.
bit_depth
=
get_bits
(
gb
,
4
)
+
1
;
pcm_bit_depth_chroma
=
get_bits
(
gb
,
4
)
+
1
;
if
(
pcm_bit_depth_chroma
!=
sps
->
pcm
.
bit_depth
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"PCM Luma bit depth (%d) is different from PCM chroma"
"bit depth (%d), this is unsupported.
\n
"
,
sps
->
pcm
.
bit_depth
,
pcm_bit_depth_chroma
);
ret
=
AVERROR_INVALIDDATA
;
goto
err
;
}
sps
->
pcm
.
bit_depth_chroma
=
get_bits
(
gb
,
4
)
+
1
;
sps
->
pcm
.
log2_min_pcm_cb_size
=
get_ue_golomb_long
(
gb
)
+
3
;
sps
->
pcm
.
log2_max_pcm_cb_size
=
sps
->
pcm
.
log2_min_pcm_cb_size
+
get_ue_golomb_long
(
gb
);
...
...
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