Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
external
libvpx
Commits
24c9d6ad
Commit
24c9d6ad
authored
Jul 22, 2014
by
Minghai Shang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[spatial svc]Use #if instead of #ifdef on macro CONFIG_SPATIAL_SVC
Change-Id: Ifc94377a0d05d66e3d21b007893a985b66db6082
parent
97ccebac
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
21 deletions
+23
-21
vp8/vp8_cx_iface.c
vp8/vp8_cx_iface.c
+1
-1
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.c
+8
-8
vp9/encoder/vp9_lookahead.h
vp9/encoder/vp9_lookahead.h
+2
-2
vp9/encoder/vp9_svc_layercontext.c
vp9/encoder/vp9_svc_layercontext.c
+2
-0
vp9/vp9_cx_iface.c
vp9/vp9_cx_iface.c
+7
-7
vpx/vpx_encoder.h
vpx/vpx_encoder.h
+3
-3
No files found.
vp8/vp8_cx_iface.c
View file @
24c9d6ad
...
...
@@ -1316,7 +1316,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] =
"vp8.fpf"
/* first pass filename */
#endif
VPX_SS_DEFAULT_LAYERS
,
/* ss_number_layers */
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
{
0
},
#endif
{
0
},
/* ss_target_bitrate */
...
...
vp9/encoder/vp9_encoder.c
View file @
24c9d6ad
...
...
@@ -2422,15 +2422,13 @@ int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags,
int
res
=
0
;
const
int
subsampling_x
=
sd
->
uv_width
<
sd
->
y_width
;
const
int
subsampling_y
=
sd
->
uv_height
<
sd
->
y_height
;
const
int
is_spatial_svc
=
cpi
->
use_svc
&&
(
cpi
->
svc
.
number_temporal_layers
==
1
);
check_initial_width
(
cpi
,
subsampling_x
,
subsampling_y
);
vpx_usec_timer_start
(
&
timer
);
#if
def
CONFIG_SPATIAL_SVC
if
(
is_spatial_svc
)
#if CONFIG_SPATIAL_SVC
if
(
cpi
->
use_svc
&&
cpi
->
svc
.
number_temporal_layers
==
1
)
res
=
vp9_svc_lookahead_push
(
cpi
,
cpi
->
lookahead
,
sd
,
time_stamp
,
end_time
,
frame_flags
);
else
...
...
@@ -2561,7 +2559,9 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
return
-
1
;
if
(
is_spatial_svc
&&
cpi
->
pass
==
2
)
{
#if CONFIG_SPATIAL_SVC
vp9_svc_lookahead_peek
(
cpi
,
cpi
->
lookahead
,
0
,
1
);
#endif
vp9_restore_layer_context
(
cpi
);
}
...
...
@@ -2584,7 +2584,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
if
(
arf_src_index
)
{
assert
(
arf_src_index
<=
rc
->
frames_to_key
);
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
is_spatial_svc
)
cpi
->
source
=
vp9_svc_lookahead_peek
(
cpi
,
cpi
->
lookahead
,
arf_src_index
,
0
);
...
...
@@ -2594,7 +2594,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
if
(
cpi
->
source
!=
NULL
)
{
cpi
->
alt_ref_source
=
cpi
->
source
;
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
is_spatial_svc
&&
cpi
->
svc
.
spatial_layer_id
>
0
)
{
int
i
;
// Reference a hidden frame from a lower layer
...
...
@@ -2629,7 +2629,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
if
(
!
cpi
->
source
)
{
// Get last frame source.
if
(
cm
->
current_video_frame
>
0
)
{
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
is_spatial_svc
)
cpi
->
last_source
=
vp9_svc_lookahead_peek
(
cpi
,
cpi
->
lookahead
,
-
1
,
0
);
else
...
...
@@ -2640,7 +2640,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
}
// Read in the source frame.
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
is_spatial_svc
)
cpi
->
source
=
vp9_svc_lookahead_pop
(
cpi
,
cpi
->
lookahead
,
flush
);
else
...
...
vp9/encoder/vp9_lookahead.h
View file @
24c9d6ad
...
...
@@ -14,7 +14,7 @@
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
#endif
...
...
@@ -31,7 +31,7 @@ struct lookahead_entry {
int64_t
ts_end
;
unsigned
int
flags
;
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
vpx_svc_parameters_t
svc_params
[
VPX_SS_MAX_LAYERS
];
#endif
};
...
...
vp9/encoder/vp9_svc_layercontext.c
View file @
24c9d6ad
...
...
@@ -223,6 +223,7 @@ int vp9_is_upper_layer_key_frame(const VP9_COMP *const cpi) {
cpi
->
svc
.
layer_context
[
cpi
->
svc
.
spatial_layer_id
].
is_key_frame
;
}
#if CONFIG_SPATIAL_SVC
int
vp9_svc_lookahead_push
(
const
VP9_COMP
*
const
cpi
,
struct
lookahead_ctx
*
ctx
,
YV12_BUFFER_CONFIG
*
src
,
int64_t
ts_start
,
int64_t
ts_end
,
unsigned
int
flags
)
{
...
...
@@ -352,3 +353,4 @@ struct lookahead_entry *vp9_svc_lookahead_pop(VP9_COMP *const cpi,
return
buf
;
}
#endif
vp9/vp9_cx_iface.c
View file @
24c9d6ad
...
...
@@ -176,7 +176,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK
(
cfg
,
ss_number_layers
,
1
,
VPX_SS_MAX_LAYERS
);
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
cfg
->
ss_number_layers
>
1
)
{
unsigned
int
i
,
alt_ref_sum
=
0
;
for
(
i
=
0
;
i
<
cfg
->
ss_number_layers
;
++
i
)
{
...
...
@@ -403,7 +403,7 @@ static vpx_codec_err_t set_encoder_config(
int
i
;
for
(
i
=
0
;
i
<
VPX_SS_MAX_LAYERS
;
++
i
)
{
oxcf
->
ss_target_bitrate
[
i
]
=
1000
*
cfg
->
ss_target_bitrate
[
i
];
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
oxcf
->
ss_play_alternate
[
i
]
=
cfg
->
ss_enable_auto_alt_ref
[
i
];
#endif
}
...
...
@@ -888,14 +888,14 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
vpx_codec_cx_pkt_t
pkt
;
VP9_COMP
*
const
cpi
=
(
VP9_COMP
*
)
ctx
->
cpi
;
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
cpi
->
use_svc
&&
cpi
->
svc
.
number_temporal_layers
==
1
)
cpi
->
svc
.
layer_context
[
cpi
->
svc
.
spatial_layer_id
].
layer_size
+=
size
;
#endif
// Pack invisible frames with the next visible frame
if
(
cpi
->
common
.
show_frame
==
0
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
||
(
cpi
->
use_svc
&&
cpi
->
svc
.
number_temporal_layers
==
1
&&
cpi
->
svc
.
spatial_layer_id
<
cpi
->
svc
.
number_spatial_layers
-
1
)
#endif
...
...
@@ -923,7 +923,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
pkt
.
data
.
frame
.
flags
=
lib_flags
<<
16
;
if
(
lib_flags
&
FRAMEFLAGS_KEY
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
||
(
cpi
->
use_svc
&&
cpi
->
svc
.
number_temporal_layers
==
1
&&
cpi
->
svc
.
layer_context
[
0
].
is_key_frame
)
#endif
...
...
@@ -965,7 +965,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
vpx_codec_pkt_list_add
(
&
ctx
->
pkt_list
.
head
,
&
pkt
);
cx_data
+=
size
;
cx_data_sz
-=
size
;
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
if
(
cpi
->
use_svc
&&
cpi
->
svc
.
number_temporal_layers
==
1
)
{
vpx_codec_cx_pkt_t
pkt
=
{
0
};
int
i
;
...
...
@@ -1287,7 +1287,7 @@ static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
9999
,
// kf_max_dist
VPX_SS_DEFAULT_LAYERS
,
// ss_number_layers
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
{
0
},
#endif
{
0
},
// ss_target_bitrate
...
...
vpx/vpx_encoder.h
View file @
24c9d6ad
...
...
@@ -157,7 +157,7 @@ extern "C" {
VPX_CODEC_STATS_PKT
,
/**< Two-pass statistics for this frame */
VPX_CODEC_FPMB_STATS_PKT
,
/**< first pass mb statistics for this frame */
VPX_CODEC_PSNR_PKT
,
/**< PSNR statistics for this frame */
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
VPX_CODEC_SPATIAL_SVC_LAYER_SIZES
,
/**< Sizes for each layer in this frame*/
#endif
VPX_CODEC_CUSTOM_PKT
=
256
/**< Algorithm extensions */
...
...
@@ -196,7 +196,7 @@ extern "C" {
double
psnr
[
4
];
/**< PSNR, total/y/u/v */
}
psnr
;
/**< data for PSNR packet */
struct
vpx_fixed_buf
raw
;
/**< data for arbitrary packets */
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
size_t
layer_sizes
[
VPX_SS_MAX_LAYERS
];
#endif
...
...
@@ -637,7 +637,7 @@ extern "C" {
*/
unsigned
int
ss_number_layers
;
#if
def
CONFIG_SPATIAL_SVC
#if CONFIG_SPATIAL_SVC
/*!\brief Enable auto alt reference flags for each spatial layer.
*
* These values specify if auto alt reference frame is enabled for each
...
...
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