Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
1cfbc86e
Commit
1cfbc86e
authored
Feb 13, 2015
by
Adrian Grange
Committed by
Gerrit Code Review
Feb 13, 2015
Browse files
Merge "Add VP9 decoder control to get frame size"
parents
48fd2e41
cf54b880
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/decode_api_test.cc
View file @
1cfbc86e
...
...
@@ -80,6 +80,7 @@ void TestVp9Controls(vpx_codec_ctx_t *dec) {
VP8D_GET_LAST_REF_UPDATES
,
VP8D_GET_FRAME_CORRUPTED
,
VP9D_GET_DISPLAY_SIZE
,
VP9D_GET_FRAME_SIZE
};
int
val
[
2
];
...
...
vp9/vp9_dx_iface.c
View file @
1cfbc86e
...
...
@@ -923,6 +923,33 @@ static vpx_codec_err_t ctrl_get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
}
}
static
vpx_codec_err_t
ctrl_get_frame_size
(
vpx_codec_alg_priv_t
*
ctx
,
va_list
args
)
{
int
*
const
frame_size
=
va_arg
(
args
,
int
*
);
// Only support this function in serial decode.
if
(
ctx
->
frame_parallel_decode
)
{
set_error_detail
(
ctx
,
"Not supported in frame parallel decode"
);
return
VPX_CODEC_INCAPABLE
;
}
if
(
frame_size
)
{
if
(
ctx
->
frame_workers
)
{
VP9Worker
*
const
worker
=
ctx
->
frame_workers
;
FrameWorkerData
*
const
frame_worker_data
=
(
FrameWorkerData
*
)
worker
->
data1
;
const
VP9_COMMON
*
const
cm
=
&
frame_worker_data
->
pbi
->
common
;
frame_size
[
0
]
=
cm
->
width
;
frame_size
[
1
]
=
cm
->
height
;
return
VPX_CODEC_OK
;
}
else
{
return
VPX_CODEC_ERROR
;
}
}
else
{
return
VPX_CODEC_INVALID_PARAM
;
}
}
static
vpx_codec_err_t
ctrl_get_display_size
(
vpx_codec_alg_priv_t
*
ctx
,
va_list
args
)
{
int
*
const
display_size
=
va_arg
(
args
,
int
*
);
...
...
@@ -1027,6 +1054,7 @@ static vpx_codec_ctrl_fn_map_t decoder_ctrl_maps[] = {
{
VP9_GET_REFERENCE
,
ctrl_get_reference
},
{
VP9D_GET_DISPLAY_SIZE
,
ctrl_get_display_size
},
{
VP9D_GET_BIT_DEPTH
,
ctrl_get_bit_depth
},
{
VP9D_GET_FRAME_SIZE
,
ctrl_get_frame_size
},
{
-
1
,
NULL
},
};
...
...
vpx/vp8dx.h
View file @
1cfbc86e
...
...
@@ -76,7 +76,14 @@ enum vp8_dec_control_id {
VPXD_SET_DECRYPTOR
,
VP8D_SET_DECRYPTOR
=
VPXD_SET_DECRYPTOR
,
/** control function to get the display dimensions for the current frame. */
/** control function to get the dimensions that the current frame is decoded
* at. This may be different to the intended display size for the frame as
* specified in the wrapper or frame header (see VP9D_GET_DISPLAY_SIZE). */
VP9D_GET_FRAME_SIZE
,
/** control function to get the current frame's intended display dimensions
* (as specified in the wrapper or frame header). This may be different to
* the decoded dimensions of this frame (see VP9D_GET_FRAME_SIZE). */
VP9D_GET_DISPLAY_SIZE
,
/** control function to get the bit depth of the stream. */
...
...
@@ -140,6 +147,7 @@ VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *)
VPX_CTRL_USE_TYPE
(
VP8D_SET_DECRYPTOR
,
vpx_decrypt_init
*
)
VPX_CTRL_USE_TYPE
(
VP9D_GET_DISPLAY_SIZE
,
int
*
)
VPX_CTRL_USE_TYPE
(
VP9D_GET_BIT_DEPTH
,
unsigned
int
*
)
VPX_CTRL_USE_TYPE
(
VP9D_GET_FRAME_SIZE
,
int
*
)
VPX_CTRL_USE_TYPE
(
VP9_INVERT_TILE_DECODE_ORDER
,
int
)
/*! @} - end defgroup vp8_decoder */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment