Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
3b47e059
Commit
3b47e059
authored
11 years ago
by
James Zern
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge "vp9/decode: add get_tile()"
parents
1bea58e4
6b00202f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/decoder/vp9_decodframe.c
+31
-27
31 additions, 27 deletions
vp9/decoder/vp9_decodframe.c
with
31 additions
and
27 deletions
vp9/decoder/vp9_decodframe.c
+
31
−
27
View file @
3b47e059
...
...
@@ -823,6 +823,27 @@ static void setup_tile_info(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
cm
->
log2_tile_rows
+=
vp9_rb_read_bit
(
rb
);
}
// Reads the next tile returning its size and adjusting '*data' accordingly
// based on 'is_last'.
static
size_t
get_tile
(
const
uint8_t
*
const
data_end
,
int
is_last
,
struct
vpx_internal_error_info
*
error_info
,
const
uint8_t
**
data
)
{
size_t
size
;
if
(
!
is_last
)
{
if
(
!
read_is_valid
(
*
data
,
4
,
data_end
))
vpx_internal_error
(
error_info
,
VPX_CODEC_CORRUPT_FRAME
,
"Truncated packet or corrupt tile length"
);
size
=
read_be32
(
*
data
);
*
data
+=
4
;
}
else
{
size
=
data_end
-
*
data
;
}
return
size
;
}
static
const
uint8_t
*
decode_tiles
(
VP9D_COMP
*
pbi
,
const
uint8_t
*
data
)
{
vp9_reader
residual_bc
;
...
...
@@ -848,20 +869,15 @@ static const uint8_t *decode_tiles(VP9D_COMP *pbi, const uint8_t *data) {
const
uint8_t
*
data_ptr2
[
4
][
1
<<
6
];
vp9_reader
bc_bak
=
{
0
};
// pre-initialize the offsets, we're going to
read
in inverse order
// pre-initialize the offsets, we're going to
decode
in inverse order
data_ptr2
[
0
][
0
]
=
data
;
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
tile_row
++
)
{
if
(
tile_row
)
{
const
int
size
=
read_be32
(
data_ptr2
[
tile_row
-
1
][
tile_cols
-
1
]);
data_ptr2
[
tile_row
-
1
][
tile_cols
-
1
]
+=
4
;
data_ptr2
[
tile_row
][
0
]
=
data_ptr2
[
tile_row
-
1
][
tile_cols
-
1
]
+
size
;
}
for
(
tile_col
=
1
;
tile_col
<
tile_cols
;
tile_col
++
)
{
const
int
size
=
read_be32
(
data_ptr2
[
tile_row
][
tile_col
-
1
]);
data_ptr2
[
tile_row
][
tile_col
-
1
]
+=
4
;
data_ptr2
[
tile_row
][
tile_col
]
=
data_ptr2
[
tile_row
][
tile_col
-
1
]
+
size
;
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
tile_col
++
)
{
const
int
last_tile
=
tile_row
==
tile_rows
-
1
&&
tile_col
==
tile_cols
-
1
;
const
size_t
size
=
get_tile
(
data_end
,
last_tile
,
&
cm
->
error
,
&
data
);
data_ptr2
[
tile_row
][
tile_col
]
=
data
;
data
+=
size
;
}
}
...
...
@@ -881,27 +897,15 @@ static const uint8_t *decode_tiles(VP9D_COMP *pbi, const uint8_t *data) {
}
residual_bc
=
bc_bak
;
}
else
{
int
has_more
;
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
tile_row
++
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
tile_col
++
)
{
const
int
last_tile
=
tile_row
==
tile_rows
-
1
&&
tile_col
==
tile_cols
-
1
;
const
size_t
size
=
get_tile
(
data_end
,
last_tile
,
&
cm
->
error
,
&
data
);
TileInfo
tile
;
size_t
size
;
vp9_tile_init
(
&
tile
,
cm
,
tile_row
,
tile_col
);
has_more
=
tile_col
<
tile_cols
-
1
||
tile_row
<
tile_rows
-
1
;
if
(
has_more
)
{
if
(
!
read_is_valid
(
data
,
4
,
data_end
))
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_CORRUPT_FRAME
,
"Truncated packet or corrupt tile length"
);
size
=
read_be32
(
data
);
data
+=
4
;
}
else
{
size
=
data_end
-
data
;
}
setup_token_decoder
(
data
,
data_end
,
size
,
&
cm
->
error
,
&
residual_bc
);
setup_tile_context
(
pbi
,
xd
,
tile_col
);
decode_tile
(
pbi
,
&
tile
,
&
residual_bc
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment