| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #include "onyxc_int.h" | 12 #include "onyxc_int.h" |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 cpi->long_rolling_actual_bits = cpi->av_per_frame_bandwidth; | 1337 cpi->long_rolling_actual_bits = cpi->av_per_frame_bandwidth; |
| 1338 cpi->max_gf_interval = (int)(cpi->output_frame_rate / 2) + 2; | 1338 cpi->max_gf_interval = (int)(cpi->output_frame_rate / 2) + 2; |
| 1339 | 1339 |
| 1340 //cpi->max_gf_interval = (int)(cpi->output_frame_rate * 2 / 3) + 1; | 1340 //cpi->max_gf_interval = (int)(cpi->output_frame_rate * 2 / 3) + 1; |
| 1341 //cpi->max_gf_interval = 24; | 1341 //cpi->max_gf_interval = 24; |
| 1342 | 1342 |
| 1343 if (cpi->max_gf_interval < 12) | 1343 if (cpi->max_gf_interval < 12) |
| 1344 cpi->max_gf_interval = 12; | 1344 cpi->max_gf_interval = 12; |
| 1345 | 1345 |
| 1346 | 1346 |
| 1347 // Special conditions when altr ref frame enabled | 1347 // Special conditions when altr ref frame enabled in lagged compress mode |
| 1348 if (cpi->oxcf.play_alternate) | 1348 if (cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames) |
| 1349 { | 1349 { |
| 1350 if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1) | 1350 if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1) |
| 1351 cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1; | 1351 cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1; |
| 1352 } | 1352 } |
| 1353 } | 1353 } |
| 1354 | 1354 |
| 1355 | 1355 |
| 1356 static int | 1356 static int |
| 1357 rescale(int val, int num, int denom) | 1357 rescale(int val, int num, int denom) |
| 1358 { | 1358 { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 | 1645 |
| 1646 // force to allowlag to 0 if lag_in_frames is 0; | 1646 // force to allowlag to 0 if lag_in_frames is 0; |
| 1647 if (cpi->oxcf.lag_in_frames == 0) | 1647 if (cpi->oxcf.lag_in_frames == 0) |
| 1648 { | 1648 { |
| 1649 cpi->oxcf.allow_lag = 0; | 1649 cpi->oxcf.allow_lag = 0; |
| 1650 } | 1650 } |
| 1651 // Limit on lag buffers as these are not currently dynamically allocated | 1651 // Limit on lag buffers as these are not currently dynamically allocated |
| 1652 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) | 1652 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) |
| 1653 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS; | 1653 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS; |
| 1654 | 1654 |
| 1655 // force play_alternate to 0 if allow_lag is 0, lag_in_frames is too small,
Mode is real time or one pass compress enabled. | |
| 1656 if (cpi->oxcf.allow_lag == 0 || cpi->oxcf.lag_in_frames <= 5 || (cpi->oxcf.M
ode < MODE_SECONDPASS)) | |
| 1657 { | |
| 1658 cpi->oxcf.play_alternate = 0; | |
| 1659 cpi->ref_frame_flags = cpi->ref_frame_flags & ~VP8_ALT_FLAG; | |
| 1660 } | |
| 1661 | |
| 1662 // YX Temp | 1655 // YX Temp |
| 1663 cpi->last_alt_ref_sei = -1; | 1656 cpi->last_alt_ref_sei = -1; |
| 1664 cpi->is_src_frame_alt_ref = 0; | 1657 cpi->is_src_frame_alt_ref = 0; |
| 1665 | 1658 |
| 1666 #if 0 | 1659 #if 0 |
| 1667 // Experimental RD Code | 1660 // Experimental RD Code |
| 1668 cpi->frame_distortion = 0; | 1661 cpi->frame_distortion = 0; |
| 1669 cpi->last_frame_distortion = 0; | 1662 cpi->last_frame_distortion = 0; |
| 1670 #endif | 1663 #endif |
| 1671 | 1664 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1930 | 1923 |
| 1931 // force to allowlag to 0 if lag_in_frames is 0; | 1924 // force to allowlag to 0 if lag_in_frames is 0; |
| 1932 if (cpi->oxcf.lag_in_frames == 0) | 1925 if (cpi->oxcf.lag_in_frames == 0) |
| 1933 { | 1926 { |
| 1934 cpi->oxcf.allow_lag = 0; | 1927 cpi->oxcf.allow_lag = 0; |
| 1935 } | 1928 } |
| 1936 // Limit on lag buffers as these are not currently dynamically allocated | 1929 // Limit on lag buffers as these are not currently dynamically allocated |
| 1937 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) | 1930 else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) |
| 1938 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS; | 1931 cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS; |
| 1939 | 1932 |
| 1940 // force play_alternate to 0 if allow_lag is 0, lag_in_frames is too small,
Mode is real time or one pass compress enabled. | |
| 1941 if (cpi->oxcf.allow_lag == 0 || cpi->oxcf.lag_in_frames <= 5 || (cpi->oxcf.M
ode < MODE_SECONDPASS)) | |
| 1942 { | |
| 1943 cpi->oxcf.play_alternate = 0; | |
| 1944 cpi->ref_frame_flags = cpi->ref_frame_flags & ~VP8_ALT_FLAG; | |
| 1945 } | |
| 1946 | |
| 1947 // YX Temp | 1933 // YX Temp |
| 1948 cpi->last_alt_ref_sei = -1; | 1934 cpi->last_alt_ref_sei = -1; |
| 1949 cpi->is_src_frame_alt_ref = 0; | 1935 cpi->is_src_frame_alt_ref = 0; |
| 1950 | 1936 |
| 1951 #if 0 | 1937 #if 0 |
| 1952 // Experimental RD Code | 1938 // Experimental RD Code |
| 1953 cpi->frame_distortion = 0; | 1939 cpi->frame_distortion = 0; |
| 1954 cpi->last_frame_distortion = 0; | 1940 cpi->last_frame_distortion = 0; |
| 1955 #endif | 1941 #endif |
| 1956 | 1942 |
| (...skipping 3259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5216 if (cm->refresh_entropy_probs == 0) | 5202 if (cm->refresh_entropy_probs == 0) |
| 5217 { | 5203 { |
| 5218 vpx_memcpy(&cm->fc, &cm->lfc, sizeof(cm->fc)); | 5204 vpx_memcpy(&cm->fc, &cm->lfc, sizeof(cm->fc)); |
| 5219 } | 5205 } |
| 5220 | 5206 |
| 5221 // if its a dropped frame honor the requests on subsequent frames | 5207 // if its a dropped frame honor the requests on subsequent frames |
| 5222 if (*size > 0) | 5208 if (*size > 0) |
| 5223 { | 5209 { |
| 5224 | 5210 |
| 5225 // return to normal state | 5211 // return to normal state |
| 5226 cpi->ref_frame_flags = VP8_ALT_FLAG | VP8_GOLD_FLAG | VP8_LAST_FLAG; | |
| 5227 | |
| 5228 cm->refresh_entropy_probs = 1; | 5212 cm->refresh_entropy_probs = 1; |
| 5229 cm->refresh_alt_ref_frame = 0; | 5213 cm->refresh_alt_ref_frame = 0; |
| 5230 cm->refresh_golden_frame = 0; | 5214 cm->refresh_golden_frame = 0; |
| 5231 cm->refresh_last_frame = 1; | 5215 cm->refresh_last_frame = 1; |
| 5232 cm->frame_type = INTER_FRAME; | 5216 cm->frame_type = INTER_FRAME; |
| 5233 | 5217 |
| 5234 } | 5218 } |
| 5235 | 5219 |
| 5236 cpi->ready_for_new_frame = 1; | 5220 cpi->ready_for_new_frame = 1; |
| 5237 | 5221 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5502 int vp8_get_speed(VP8_PTR c) | 5486 int vp8_get_speed(VP8_PTR c) |
| 5503 { | 5487 { |
| 5504 VP8_COMP *cpi = (VP8_COMP *) c; | 5488 VP8_COMP *cpi = (VP8_COMP *) c; |
| 5505 return cpi->Speed; | 5489 return cpi->Speed; |
| 5506 } | 5490 } |
| 5507 int vp8_get_quantizer(VP8_PTR c) | 5491 int vp8_get_quantizer(VP8_PTR c) |
| 5508 { | 5492 { |
| 5509 VP8_COMP *cpi = (VP8_COMP *) c; | 5493 VP8_COMP *cpi = (VP8_COMP *) c; |
| 5510 return cpi->common.base_qindex; | 5494 return cpi->common.base_qindex; |
| 5511 } | 5495 } |
| OLD | NEW |