Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
4618952a
Commit
4618952a
authored
Feb 12, 2014
by
Adrian Grange
Committed by
Gerrit Code Review
Feb 12, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Minor cleanup."
parents
3602c431
896a9ab9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
32 deletions
+21
-32
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_if.c
+7
-8
vp9/vp9_cx_iface.c
vp9/vp9_cx_iface.c
+14
-24
No files found.
vp9/encoder/vp9_onyx_if.c
View file @
4618952a
...
...
@@ -1474,7 +1474,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
if
(
cpi
->
initial_width
)
{
// Increasing the size of the frame beyond the first seen frame, or some
// otherwise signal
l
ed maximum size, is not supported.
// otherwise signaled maximum size, is not supported.
// TODO(jkoleszar): exit gracefully.
assert
(
cm
->
width
<=
cpi
->
initial_width
);
assert
(
cm
->
height
<=
cpi
->
initial_height
);
...
...
@@ -1489,14 +1489,13 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi
->
speed
=
cpi
->
oxcf
.
cpu_used
;
if
(
cpi
->
oxcf
.
lag_in_frames
==
0
)
{
//
f
orce
to
allowlag to 0 if lag_in_frames is 0
;
//
F
orce allow
_
lag to 0 if lag_in_frames is 0
.
cpi
->
oxcf
.
allow_lag
=
0
;
}
else
if
(
cpi
->
oxcf
.
lag_in_frames
>
MAX_LAG_BUFFERS
)
{
// Limit on lag buffers as these are not currently dynamically allocated
// Limit on lag buffers as these are not currently dynamically allocated
.
cpi
->
oxcf
.
lag_in_frames
=
MAX_LAG_BUFFERS
;
}
// YX Temp
#if CONFIG_MULTIPLE_ARF
vp9_zero
(
cpi
->
alt_ref_source
);
#else
...
...
@@ -3954,11 +3953,11 @@ int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
cm
->
width
=
width
;
if
(
cm
->
width
*
5
<
cpi
->
initial_width
)
{
cm
->
width
=
cpi
->
initial_width
/
5
+
1
;
printf
(
"Warning: Desired width too small, changed to %d
\n
"
,
cm
->
width
);
printf
(
"Warning: Desired width too small, changed to %d
\n
"
,
cm
->
width
);
}
if
(
cm
->
width
>
cpi
->
initial_width
)
{
cm
->
width
=
cpi
->
initial_width
;
printf
(
"Warning: Desired width too large, changed to %d
\n
"
,
cm
->
width
);
printf
(
"Warning: Desired width too large, changed to %d
\n
"
,
cm
->
width
);
}
}
...
...
@@ -3966,11 +3965,11 @@ int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
cm
->
height
=
height
;
if
(
cm
->
height
*
5
<
cpi
->
initial_height
)
{
cm
->
height
=
cpi
->
initial_height
/
5
+
1
;
printf
(
"Warning: Desired height too small, changed to %d
\n
"
,
cm
->
height
);
printf
(
"Warning: Desired height too small, changed to %d
\n
"
,
cm
->
height
);
}
if
(
cm
->
height
>
cpi
->
initial_height
)
{
cm
->
height
=
cpi
->
initial_height
;
printf
(
"Warning: Desired height too large, changed to %d
\n
"
,
cm
->
height
);
printf
(
"Warning: Desired height too large, changed to %d
\n
"
,
cm
->
height
);
}
}
...
...
vp9/vp9_cx_iface.c
View file @
4618952a
...
...
@@ -222,7 +222,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
int
n_packets
=
(
int
)(
cfg
->
rc_twopass_stats_in
.
sz
/
packet_sz
);
FIRSTPASS_STATS
*
stats
;
if
(
!
cfg
->
rc_twopass_stats_in
.
buf
)
if
(
cfg
->
rc_twopass_stats_in
.
buf
==
NULL
)
ERROR
(
"rc_twopass_stats_in.buf not set."
);
if
(
cfg
->
rc_twopass_stats_in
.
sz
%
packet_sz
)
...
...
@@ -419,7 +419,7 @@ static vpx_codec_err_t vp9e_set_config(vpx_codec_alg_priv_t *ctx,
res
=
validate_config
(
ctx
,
cfg
,
&
ctx
->
vp8_cfg
);
if
(
!
res
)
{
if
(
res
==
VPX_CODEC_OK
)
{
ctx
->
cfg
=
*
cfg
;
set_vp9e_config
(
&
ctx
->
oxcf
,
ctx
->
cfg
,
ctx
->
vp8_cfg
);
vp9_change_config
(
ctx
->
cpi
,
&
ctx
->
oxcf
);
...
...
@@ -439,8 +439,7 @@ static vpx_codec_err_t get_param(vpx_codec_alg_priv_t *ctx,
#define MAP(id, var) case id: *(RECAST(id, arg)) = var; break
if
(
!
arg
)
return
VPX_CODEC_INVALID_PARAM
;
if
(
arg
==
NULL
)
return
VPX_CODEC_INVALID_PARAM
;
switch
(
ctrl_id
)
{
MAP
(
VP8E_GET_LAST_QUANTIZER
,
vp9_get_quantizer
(
ctx
->
cpi
));
...
...
@@ -482,7 +481,7 @@ static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx,
res
=
validate_config
(
ctx
,
&
ctx
->
cfg
,
&
xcfg
);
if
(
!
res
)
{
if
(
res
==
VPX_CODEC_OK
)
{
ctx
->
vp8_cfg
=
xcfg
;
set_vp9e_config
(
&
ctx
->
oxcf
,
ctx
->
cfg
,
ctx
->
vp8_cfg
);
vp9_change_config
(
ctx
->
cpi
,
&
ctx
->
oxcf
);
...
...
@@ -501,12 +500,10 @@ static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx) {
VP9_PTR
optr
;
if
(
!
ctx
->
priv
)
{
if
(
ctx
->
priv
==
NULL
)
{
priv
=
calloc
(
1
,
sizeof
(
struct
vpx_codec_alg_priv
));
if
(
!
priv
)
{
return
VPX_CODEC_MEM_ERROR
;
}
if
(
priv
==
NULL
)
return
VPX_CODEC_MEM_ERROR
;
ctx
->
priv
=
&
priv
->
base
;
ctx
->
priv
->
sz
=
sizeof
(
*
ctx
->
priv
);
...
...
@@ -543,21 +540,19 @@ static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx) {
priv
->
cx_data
=
malloc
(
priv
->
cx_data_sz
);
if
(
!
priv
->
cx_data
)
{
return
VPX_CODEC_MEM_ERROR
;
}
if
(
priv
->
cx_data
==
NULL
)
return
VPX_CODEC_MEM_ERROR
;
vp9_initialize_enc
();
res
=
validate_config
(
priv
,
&
priv
->
cfg
,
&
priv
->
vp8_cfg
);
if
(
!
res
)
{
if
(
res
==
VPX_CODEC_OK
)
{
set_vp9e_config
(
&
ctx
->
priv
->
alg_priv
->
oxcf
,
ctx
->
priv
->
alg_priv
->
cfg
,
ctx
->
priv
->
alg_priv
->
vp8_cfg
);
optr
=
vp9_create_compressor
(
&
ctx
->
priv
->
alg_priv
->
oxcf
);
if
(
!
optr
)
if
(
optr
==
NULL
)
res
=
VPX_CODEC_MEM_ERROR
;
else
ctx
->
priv
->
alg_priv
->
cpi
=
optr
;
...
...
@@ -725,7 +720,7 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
}
/* Initialize the encoder instance on the first frame. */
if
(
!
res
&&
ctx
->
cpi
)
{
if
(
res
==
VPX_CODEC_OK
&&
ctx
->
cpi
!=
NULL
)
{
unsigned
int
lib_flags
;
YV12_BUFFER_CONFIG
sd
;
int64_t
dst_time_stamp
,
dst_end_time_stamp
;
...
...
@@ -785,8 +780,8 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
VP9_COMP
*
cpi
=
(
VP9_COMP
*
)
ctx
->
cpi
;
/* Pack invisible frames with the next visible frame */
if
(
!
cpi
->
common
.
show_frame
)
{
if
(
!
ctx
->
pending_cx_data
)
if
(
cpi
->
common
.
show_frame
==
0
)
{
if
(
ctx
->
pending_cx_data
==
0
)
ctx
->
pending_cx_data
=
cx_data
;
ctx
->
pending_cx_data_sz
+=
size
;
ctx
->
pending_frame_sizes
[
ctx
->
pending_frame_count
++
]
=
size
;
...
...
@@ -811,7 +806,7 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
if
(
lib_flags
&
FRAMEFLAGS_KEY
)
pkt
.
data
.
frame
.
flags
|=
VPX_FRAME_IS_KEY
;
if
(
!
cpi
->
common
.
show_frame
)
{
if
(
cpi
->
common
.
show_frame
==
0
)
{
pkt
.
data
.
frame
.
flags
|=
VPX_FRAME_IS_INVISIBLE
;
// This timestamp should be as close as possible to the
...
...
@@ -1021,12 +1016,7 @@ static vpx_codec_err_t vp9e_set_scalemode(vpx_codec_alg_priv_t *ctx,
res
=
vp9_set_internal_size
(
ctx
->
cpi
,
(
VPX_SCALING
)
scalemode
->
h_scaling_mode
,
(
VPX_SCALING
)
scalemode
->
v_scaling_mode
);
if
(
!
res
)
{
return
VPX_CODEC_OK
;
}
else
{
return
VPX_CODEC_INVALID_PARAM
;
}
return
(
res
==
0
)
?
VPX_CODEC_OK
:
VPX_CODEC_INVALID_PARAM
;
}
else
{
return
VPX_CODEC_INVALID_PARAM
;
}
...
...
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