diff options
author | Minghai Shang <minghai@google.com> | 2014-09-22 14:01:24 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-09-22 14:01:24 -0700 |
commit | 38b6aed8fdf50e701c070e708ff7933cc3a61117 (patch) | |
tree | e2aceffcf62d8461b4398fba9ae83439bdedfc26 /vp9/encoder/vp9_encoder.c | |
parent | 45a577e83ccd84635b8357caa2fd8e021e3d3e1e (diff) | |
parent | 209ee12110cad5eaeb2b80b18c5b7ae5029c9c80 (diff) | |
download | libvpx-38b6aed8fdf50e701c070e708ff7933cc3a61117.tar libvpx-38b6aed8fdf50e701c070e708ff7933cc3a61117.tar.gz libvpx-38b6aed8fdf50e701c070e708ff7933cc3a61117.tar.bz2 libvpx-38b6aed8fdf50e701c070e708ff7933cc3a61117.zip |
Merge "[spatial svc] Remove vpx_svc_parameters_t and the loop that sets it for each layer"
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r-- | vp9/encoder/vp9_encoder.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 107bed5a1..5f5af192c 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2448,15 +2448,7 @@ int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags, vpx_usec_timer_start(&timer); -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi)) - res = vp9_svc_lookahead_push(cpi, cpi->lookahead, sd, time_stamp, end_time, - frame_flags); - else -#endif - res = vp9_lookahead_push(cpi->lookahead, - sd, time_stamp, end_time, frame_flags); - if (res) + if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, frame_flags)) res = -1; vpx_usec_timer_mark(&timer); cpi->time_receive_data += vpx_usec_timer_elapsed(&timer); @@ -2585,11 +2577,12 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, MV_REFERENCE_FRAME ref_frame; int arf_src_index; - if (is_two_pass_svc(cpi) && oxcf->pass == 2) { + if (is_two_pass_svc(cpi)) { #if CONFIG_SPATIAL_SVC - vp9_svc_lookahead_peek(cpi, cpi->lookahead, 0, 1); + vp9_svc_start_frame(cpi); #endif - vp9_restore_layer_context(cpi); + if (oxcf->pass == 2) + vp9_restore_layer_context(cpi); } vpx_usec_timer_start(&cmptimer); @@ -2608,13 +2601,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 CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi)) - source = vp9_svc_lookahead_peek(cpi, cpi->lookahead, arf_src_index, 0); - else -#endif - source = vp9_lookahead_peek(cpi->lookahead, arf_src_index); - if (source != NULL) { + if ((source = vp9_lookahead_peek(cpi->lookahead, arf_src_index)) != NULL) { cpi->alt_ref_source = source; #if CONFIG_SPATIAL_SVC @@ -2652,13 +2639,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, if (!source) { // Get last frame source. if (cm->current_video_frame > 0) { -#if CONFIG_SPATIAL_SVC - if (is_two_pass_svc(cpi)) - last_source = vp9_svc_lookahead_peek(cpi, cpi->lookahead, -1, 0); - else -#endif - last_source = vp9_lookahead_peek(cpi->lookahead, -1); - if (last_source == NULL) + if ((last_source = vp9_lookahead_peek(cpi->lookahead, -1)) == NULL) return -1; } @@ -2918,6 +2899,12 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags, } #endif + + if (is_two_pass_svc(cpi) && cm->show_frame) { + ++cpi->svc.spatial_layer_to_encode; + if (cpi->svc.spatial_layer_to_encode >= cpi->svc.number_spatial_layers) + cpi->svc.spatial_layer_to_encode = 0; + } return 0; } |