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
21c06c40
Commit
21c06c40
authored
Nov 25, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/hapdec : use gray8 for HapAlphaOnly decoding instead of RGB0
parent
07e427aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
hap.h
libavcodec/hap.h
+1
-0
hapdec.c
libavcodec/hapdec.c
+6
-4
No files found.
libavcodec/hap.h
View file @
21c06c40
...
@@ -84,6 +84,7 @@ typedef struct HapContext {
...
@@ -84,6 +84,7 @@ typedef struct HapContext {
int
texture_count
;
/* 2 for HAQA, 1 for other version */
int
texture_count
;
/* 2 for HAQA, 1 for other version */
int
texture_section_size
;
/* size of the part of the texture section (for HAPQA) */
int
texture_section_size
;
/* size of the part of the texture section (for HAPQA) */
int
uncompress_pix_size
;
/* nb of byte / pixel for the target picture */
/* Pointer to the selected compress or decompress function */
/* Pointer to the selected compress or decompress function */
int
(
*
tex_fun
)(
uint8_t
*
dst
,
ptrdiff_t
stride
,
const
uint8_t
*
block
);
int
(
*
tex_fun
)(
uint8_t
*
dst
,
ptrdiff_t
stride
,
const
uint8_t
*
block
);
...
...
libavcodec/hapdec.c
View file @
21c06c40
...
@@ -300,10 +300,10 @@ static int decompress_texture_thread_internal(AVCodecContext *avctx, void *arg,
...
@@ -300,10 +300,10 @@ static int decompress_texture_thread_internal(AVCodecContext *avctx, void *arg,
int
off
=
y
*
w_block
;
int
off
=
y
*
w_block
;
for
(
x
=
0
;
x
<
w_block
;
x
++
)
{
for
(
x
=
0
;
x
<
w_block
;
x
++
)
{
if
(
texture_num
==
0
)
{
if
(
texture_num
==
0
)
{
ctx
->
tex_fun
(
p
+
x
*
16
,
frame
->
linesize
[
0
],
ctx
->
tex_fun
(
p
+
x
*
4
*
ctx
->
uncompress_pix_size
,
frame
->
linesize
[
0
],
d
+
(
off
+
x
)
*
ctx
->
tex_rat
);
d
+
(
off
+
x
)
*
ctx
->
tex_rat
);
}
else
{
}
else
{
ctx
->
tex_fun2
(
p
+
x
*
16
,
frame
->
linesize
[
0
],
ctx
->
tex_fun2
(
p
+
x
*
4
*
ctx
->
uncompress_pix_size
,
frame
->
linesize
[
0
],
d
+
(
off
+
x
)
*
ctx
->
tex_rat2
);
d
+
(
off
+
x
)
*
ctx
->
tex_rat2
);
}
}
}
}
...
@@ -438,6 +438,7 @@ static av_cold int hap_init(AVCodecContext *avctx)
...
@@ -438,6 +438,7 @@ static av_cold int hap_init(AVCodecContext *avctx)
ff_texturedsp_init
(
&
ctx
->
dxtc
);
ff_texturedsp_init
(
&
ctx
->
dxtc
);
ctx
->
texture_count
=
1
;
ctx
->
texture_count
=
1
;
ctx
->
uncompress_pix_size
=
4
;
switch
(
avctx
->
codec_tag
)
{
switch
(
avctx
->
codec_tag
)
{
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'1'
):
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'1'
):
...
@@ -461,8 +462,9 @@ static av_cold int hap_init(AVCodecContext *avctx)
...
@@ -461,8 +462,9 @@ static av_cold int hap_init(AVCodecContext *avctx)
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'A'
):
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'A'
):
texture_name
=
"RGTC1"
;
texture_name
=
"RGTC1"
;
ctx
->
tex_rat
=
8
;
ctx
->
tex_rat
=
8
;
ctx
->
tex_fun
=
ctx
->
dxtc
.
rgtc1u_block
;
ctx
->
tex_fun
=
ctx
->
dxtc
.
rgtc1u_gray_block
;
avctx
->
pix_fmt
=
AV_PIX_FMT_RGB0
;
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
ctx
->
uncompress_pix_size
=
1
;
break
;
break
;
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'M'
):
case
MKTAG
(
'H'
,
'a'
,
'p'
,
'M'
):
texture_name
=
"DXT5-YCoCg-scaled / RGTC1"
;
texture_name
=
"DXT5-YCoCg-scaled / RGTC1"
;
...
...
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