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
cab71e4e
Commit
cab71e4e
authored
Sep 23, 2017
by
Martin Vignali
Committed by
Michael Niedermayer
Sep 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavcodec/hapdec : add support HapAlphaOnly
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
45c15b74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
hap.h
libavcodec/hap.h
+1
-0
hapdec.c
libavcodec/hapdec.c
+12
-2
No files found.
libavcodec/hap.h
View file @
cab71e4e
...
...
@@ -34,6 +34,7 @@ enum HapTextureFormat {
HAP_FMT_RGBDXT1
=
0x0B
,
HAP_FMT_RGBADXT5
=
0x0E
,
HAP_FMT_YCOCGDXT5
=
0x0F
,
HAP_FMT_RGTC1
=
0x01
,
};
enum
HapCompressor
{
...
...
libavcodec/hapdec.c
View file @
cab71e4e
...
...
@@ -24,7 +24,7 @@
* @file
* Hap decoder
*
* Fourcc: Hap1, Hap5, HapY
* Fourcc: Hap1, Hap5, HapY
, HapA, HapM
*
* https://github.com/Vidvox/hap/blob/master/documentation/HapVideoDRAFT.md
*/
...
...
@@ -163,7 +163,8 @@ static int hap_parse_frame_header(AVCodecContext *avctx)
if
((
avctx
->
codec_tag
==
MKTAG
(
'H'
,
'a'
,
'p'
,
'1'
)
&&
(
section_type
&
0x0F
)
!=
HAP_FMT_RGBDXT1
)
||
(
avctx
->
codec_tag
==
MKTAG
(
'H'
,
'a'
,
'p'
,
'5'
)
&&
(
section_type
&
0x0F
)
!=
HAP_FMT_RGBADXT5
)
||
(
avctx
->
codec_tag
==
MKTAG
(
'H'
,
'a'
,
'p'
,
'Y'
)
&&
(
section_type
&
0x0F
)
!=
HAP_FMT_YCOCGDXT5
))
{
(
avctx
->
codec_tag
==
MKTAG
(
'H'
,
'a'
,
'p'
,
'Y'
)
&&
(
section_type
&
0x0F
)
!=
HAP_FMT_YCOCGDXT5
)
||
(
avctx
->
codec_tag
==
MKTAG
(
'H'
,
'a'
,
'p'
,
'A'
)
&&
(
section_type
&
0x0F
)
!=
HAP_FMT_RGTC1
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid texture format %#04x.
\n
"
,
section_type
&
0x0F
);
return
AVERROR_INVALIDDATA
;
...
...
@@ -403,6 +404,15 @@ static av_cold int hap_init(AVCodecContext *avctx)
ctx
->
tex_fun
=
ctx
->
dxtc
.
dxt5ys_block
;
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB0
;
break
;
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'A'
):
texture_name
=
"RGTC1"
;
ctx
->
tex_rat
=
8
;
ctx
->
tex_fun
=
ctx
->
dxtc
.
rgtc1u_block
;
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB0
;
break
;
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'M'
):
avpriv_report_missing_feature
(
avctx
,
"HapQAlpha"
);
return
AVERROR_PATCHWELCOME
;
default:
return
AVERROR_DECODER_NOT_FOUND
;
}
...
...
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