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
fca89199
Commit
fca89199
authored
Nov 21, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/hapdec : indent after previous commit
parent
518b9ee3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
hapdec.c
libavcodec/hapdec.c
+33
-33
No files found.
libavcodec/hapdec.c
View file @
fca89199
...
@@ -334,47 +334,47 @@ static int hap_decode(AVCodecContext *avctx, void *data,
...
@@ -334,47 +334,47 @@ static int hap_decode(AVCodecContext *avctx, void *data,
for
(
t
=
0
;
t
<
ctx
->
texture_count
;
t
++
)
{
for
(
t
=
0
;
t
<
ctx
->
texture_count
;
t
++
)
{
bytestream2_seek
(
&
ctx
->
gbc
,
start_texture_section
,
SEEK_SET
);
bytestream2_seek
(
&
ctx
->
gbc
,
start_texture_section
,
SEEK_SET
);
/* Check for section header */
/* Check for section header */
ret
=
hap_parse_frame_header
(
avctx
);
ret
=
hap_parse_frame_header
(
avctx
);
if
(
ret
<
0
)
return
ret
;
if
(
avctx
->
codec
->
update_thread_context
)
ff_thread_finish_setup
(
avctx
);
/* Unpack the DXT texture */
if
(
hap_can_use_tex_in_place
(
ctx
))
{
/* Only DXTC texture compression in a contiguous block */
ctx
->
tex_data
=
ctx
->
gbc
.
buffer
;
tex_size
=
bytestream2_get_bytes_left
(
&
ctx
->
gbc
);
}
else
{
/* Perform the second-stage decompression */
ret
=
av_reallocp
(
&
ctx
->
tex_buf
,
ctx
->
tex_size
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
avctx
->
execute2
(
avctx
,
decompress_chunks_thread
,
NULL
,
if
(
avctx
->
codec
->
update_thread_context
)
ctx
->
chunk_results
,
ctx
->
chunk_count
);
ff_thread_finish_setup
(
avctx
);
for
(
i
=
0
;
i
<
ctx
->
chunk_count
;
i
++
)
{
/* Unpack the DXT texture */
if
(
ctx
->
chunk_results
[
i
]
<
0
)
if
(
hap_can_use_tex_in_place
(
ctx
))
{
return
ctx
->
chunk_results
[
i
];
/* Only DXTC texture compression in a contiguous block */
}
ctx
->
tex_data
=
ctx
->
gbc
.
buffer
;
tex_size
=
bytestream2_get_bytes_left
(
&
ctx
->
gbc
);
}
else
{
/* Perform the second-stage decompression */
ret
=
av_reallocp
(
&
ctx
->
tex_buf
,
ctx
->
tex_size
);
if
(
ret
<
0
)
return
ret
;
ctx
->
tex_data
=
ctx
->
tex_buf
;
avctx
->
execute2
(
avctx
,
decompress_chunks_thread
,
NULL
,
tex_size
=
ctx
->
tex_size
;
ctx
->
chunk_results
,
ctx
->
chunk_count
);
}
if
(
tex_size
<
(
avctx
->
coded_width
/
TEXTURE_BLOCK_W
)
for
(
i
=
0
;
i
<
ctx
->
chunk_count
;
i
++
)
{
*
(
avctx
->
coded_height
/
TEXTURE_BLOCK_H
)
if
(
ctx
->
chunk_results
[
i
]
<
0
)
*
ctx
->
tex_rat
)
{
return
ctx
->
chunk_results
[
i
];
av_log
(
avctx
,
AV_LOG_ERROR
,
"Insufficient data
\n
"
);
}
return
AVERROR_INVALIDDATA
;
}
ctx
->
tex_data
=
ctx
->
tex_buf
;
tex_size
=
ctx
->
tex_size
;
}
if
(
tex_size
<
(
avctx
->
coded_width
/
TEXTURE_BLOCK_W
)
*
(
avctx
->
coded_height
/
TEXTURE_BLOCK_H
)
*
ctx
->
tex_rat
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Insufficient data
\n
"
);
return
AVERROR_INVALIDDATA
;
}
/* Use the decompress function on the texture, one block per thread */
/* Use the decompress function on the texture, one block per thread */
if
(
t
==
0
){
if
(
t
==
0
){
avctx
->
execute2
(
avctx
,
decompress_texture_thread
,
tframe
.
f
,
NULL
,
ctx
->
slice_count
);
avctx
->
execute2
(
avctx
,
decompress_texture_thread
,
tframe
.
f
,
NULL
,
ctx
->
slice_count
);
}
}
}
}
...
...
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