diff options
author | Minghai Shang <minghai@google.com> | 2014-09-18 18:05:07 -0700 |
---|---|---|
committer | Minghai Shang <minghai@google.com> | 2014-09-18 18:05:07 -0700 |
commit | 209ee12110cad5eaeb2b80b18c5b7ae5029c9c80 (patch) | |
tree | 59a753bf5b661bb45e2945c65cb23e0514bac076 /vp9/encoder/vp9_encoder.c | |
parent | 4f5b2b28924fa63f88449e203905ec88168bbda7 (diff) | |
download | libvpx-209ee12110cad5eaeb2b80b18c5b7ae5029c9c80.tar libvpx-209ee12110cad5eaeb2b80b18c5b7ae5029c9c80.tar.gz libvpx-209ee12110cad5eaeb2b80b18c5b7ae5029c9c80.tar.bz2 libvpx-209ee12110cad5eaeb2b80b18c5b7ae5029c9c80.zip |
[spatial svc] Remove vpx_svc_parameters_t and the loop that sets it for each layer
vpx_svc_parameters_t contains id, resolution and min/max qp for each spatial layer.
In this change we will use extra config to send min/max qp and scaling factors, then calculate layer resolution inside encoder.
Change-Id: Ib673303266605fe803c3b067284aae5f7a25514a
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 9545ba0f3..1de797e9a 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2446,15 +2446,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); @@ -2583,11 +2575,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); @@ -2606,13 +2599,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 @@ -2650,13 +2637,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; } @@ -2909,6 +2890,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; } |