From 09202d80716ef7e2931de60c66b6fb2383f52613 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Fri, 4 Jun 2010 16:19:40 -0400 Subject: LICENSE: update with latest text Change-Id: Ieebea089095d9073b3a94932791099f614ce120c --- vp8/vp8_cx_iface.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 16ad678b6..d04e4767c 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1,10 +1,11 @@ /* * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. * - * Use of this source code is governed by a BSD-style license and patent - * grant that can be found in the LICENSE file in the root of the source - * tree. All contributing project authors may be found in the AUTHORS - * file in the root of the source tree. + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. */ -- cgit v1.2.3 From 317a66693b690eadd886d55286a24f428d7c50e5 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 10 Jun 2010 12:08:01 -0400 Subject: Remove reference to 'vpx Technologies' Vestigial. Change-Id: Iffa9e6d5ba5199b136d7549890101da17c11e3c3 --- vp8/vp8_cx_iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index d04e4767c..9c05a642a 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1068,7 +1068,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] = #endif vpx_codec_iface_t vpx_codec_vp8_cx_algo = { - "vpx Technologies VP8 Encoder" VERSION_STRING, + "WebM Project VP8 Encoder" VERSION_STRING, VPX_CODEC_INTERNAL_ABI_VERSION, VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR, /* vpx_codec_caps_t caps; */ @@ -1157,7 +1157,7 @@ static vpx_codec_err_t api1_encode(vpx_codec_alg_priv_t *ctx, vpx_codec_iface_t vpx_enc_vp8_algo = { - "vpx Technologies VP8 Encoder (Deprecated API)" VERSION_STRING, + "WebM Project VP8 Encoder (Deprecated API)" VERSION_STRING, VPX_CODEC_INTERNAL_ABI_VERSION, VPX_CODEC_CAP_ENCODER, /* vpx_codec_caps_t caps; */ -- cgit v1.2.3 From 5a72620de96d2e2eafb353123ffad0d7122efcbc Mon Sep 17 00:00:00 2001 From: Guillermo Ballester Valor Date: Fri, 11 Jun 2010 14:33:49 -0400 Subject: Fix compiler warnings Change-Id: I2a97f08cc3c7808ce5be39e910cc5147ecf03a1d --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 9c05a642a..69d95d86f 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -109,7 +109,7 @@ update_error_state(vpx_codec_alg_priv_t *ctx, } while(0) #define RANGE_CHECK(p,memb,lo,hi) do {\ - if(!((p)->memb >= (lo) && (p)->memb <= hi)) \ + if(!(((p)->memb == lo || (p)->memb > (lo)) && (p)->memb <= hi)) \ ERROR(#memb " out of range ["#lo".."#hi"]");\ } while(0) -- cgit v1.2.3 From 89c8b3dbc6400ccfcbe5f0dcfe5ccc4fd320f500 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Mon, 14 Jun 2010 10:22:55 -0400 Subject: vp8_cx_iface: set default cpu used to 0 Change-Id: I7b35f4717cdd204224112f72471b551617262417 --- vp8/vp8_cx_iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 69d95d86f..d63c03938 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -53,15 +53,15 @@ static const struct extraconfig_map extracfg_map[] = NULL, #if !(CONFIG_REALTIME_ONLY) VP8_BEST_QUALITY_ENCODING, /* Encoding Mode */ - -4, /* cpu_used */ + 0, /* cpu_used */ #else VP8_REAL_TIME_ENCODING, /* Encoding Mode */ - -8, /* cpu_used */ + 4, /* cpu_used */ #endif 0, /* enable_auto_alt_ref */ 0, /* noise_sensitivity */ 0, /* Sharpness */ - 800, /* static_thresh */ + 0, /* static_thresh */ VP8_ONE_TOKENPARTITION, /* token_partitions */ 0, /* arnr_max_frames */ 0, /* arnr_strength */ -- cgit v1.2.3 From 94c52e4da8a3532989c84f6b0da695dfaeb18449 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Fri, 18 Jun 2010 12:39:21 -0400 Subject: cosmetics: trim trailing whitespace When the license headers were updated, they accidentally contained trailing whitespace, so unfortunately we have to touch all the files again. Change-Id: I236c05fade06589e417179c0444cb39b09e4200d --- vp8/vp8_cx_iface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index d63c03938..666432751 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1,10 +1,10 @@ /* * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. * - * Use of this source code is governed by a BSD-style license + * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may + * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -- cgit v1.2.3 From 02277b8aa34a007ab211475605926b5942257658 Mon Sep 17 00:00:00 2001 From: Paul Wilkins Date: Mon, 19 Jul 2010 11:32:09 +0100 Subject: Parameter limit change. Change maximum ARNR filter width to 15. Change-Id: I3b72450ea08e96287445ec18810630ee2292954c --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 666432751..d0c47b35a 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -178,7 +178,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION); RANGE_CHECK(vp8_cfg, Sharpness, 0, 7); - RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 25); + RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15); RANGE_CHECK(vp8_cfg, arnr_strength, 0, 6); RANGE_CHECK(vp8_cfg, arnr_type, 0, 0xffffffff); -- cgit v1.2.3 From 8e7ebacb19be1a44a9b724ead70f7ae40a6827c3 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Fri, 20 Aug 2010 11:04:10 -0400 Subject: increase rate control buffer level precision The external API exposes the RC initial/optimal/full buffer level in milliseconds, but this value was truncated internally to seconds. This patch allows the use of the full precision during the conversion from time to bits. Change-Id: If8dd2a87614c05747f81432cbe75dd9e6ed2f04e --- vp8/vp8_cx_iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index d0c47b35a..40cb73776 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -296,9 +296,9 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf, oxcf->under_shoot_pct = cfg.rc_undershoot_pct; //oxcf->over_shoot_pct = cfg.rc_overshoot_pct; - oxcf->maximum_buffer_size = cfg.rc_buf_sz / 1000; - oxcf->starting_buffer_level = cfg.rc_buf_initial_sz / 1000; - oxcf->optimal_buffer_level = cfg.rc_buf_optimal_sz / 1000; + oxcf->maximum_buffer_size = cfg.rc_buf_sz; + oxcf->starting_buffer_level = cfg.rc_buf_initial_sz; + oxcf->optimal_buffer_level = cfg.rc_buf_optimal_sz; oxcf->two_pass_vbrbias = cfg.rc_2pass_vbr_bias_pct; oxcf->two_pass_vbrmin_section = cfg.rc_2pass_vbr_minsection_pct; -- cgit v1.2.3 From 23216211bc27bd90bd4b32a4730e839a4de29559 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 2 Sep 2010 09:32:03 -0400 Subject: Disable frame dropping by default This is not the behavior that most users expect. Change-Id: I226126ea400c22cf1f7918e80ea7fe0771c569cb --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 40cb73776..3cc84fc76 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1024,7 +1024,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] = 0, /* g_lag_in_frames */ - 70, /* rc_dropframe_thresh */ + 0, /* rc_dropframe_thresh */ 0, /* rc_resize_allowed */ 60, /* rc_resize_down_thresold */ 30, /* rc_resize_up_thresold */ -- cgit v1.2.3 From 76640f85dac7145a7f275ca04708496fc136bbe5 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 20 Aug 2010 16:06:56 -0400 Subject: encoder: remove postproc dependency Remove the dependency on postproc.c for the encoder in general, the only unchecked need for it is when CONFIG_PSNR is enabled. All other cases are already wrapped in CONFIG_POSTPROC. In the CONFIG_PSNR case the file will still be included. Additionally, when VP8_SET_POSTPROC is used with the encoder when post processing has been disabled an error will be returned. This addresses issue #153. Change-Id: Ia6dfe20167f7077734a6058cbd1d794550346089 --- vp8/vp8_cx_iface.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 3cc84fc76..da74a4fc8 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -826,7 +826,9 @@ static vpx_codec_err_t vp8e_set_previewpp(vpx_codec_alg_priv_t *ctx, int ctr_id, va_list args) { +#if CONFIG_POSTPROC vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *); + (void)ctr_id; if (data) { @@ -835,6 +837,12 @@ static vpx_codec_err_t vp8e_set_previewpp(vpx_codec_alg_priv_t *ctx, } else return VPX_CODEC_INVALID_PARAM; +#else + (void)ctx; + (void)ctr_id; + (void)args; + return VPX_CODEC_INCAPABLE; +#endif } -- cgit v1.2.3 From c2140b8af169a6d93a70efc403a5956f5ec84dba Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 9 Sep 2010 08:16:39 -0400 Subject: Use WebM in copyright notice for consistency Changes 'The VP8 project' to 'The WebM project', for consistency with other webmproject.org repositories. Fixes issue #97. Change-Id: I37c13ed5fbdb9d334ceef71c6350e9febed9bbba --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index da74a4fc8..8845368fb 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source -- cgit v1.2.3 From 236906863a043f63e2e92c91b5f6d73939aaa6df Mon Sep 17 00:00:00 2001 From: Guillermo Ballester Valor Date: Fri, 11 Jun 2010 14:33:49 -0400 Subject: Add high limit check for unsigned parameters The patch related with issue #55 (5a72620) fixed some warnings, but the fix was not optimal. It actually was a trick to confuse compiler rather than a fix. This patch fixes it by creating a new macro used when needed just a high limit check for an unsigned. Change-Id: I94b322e0f7fb07604b3b1df1f9321185f48cfcb5 --- vp8/vp8_cx_iface.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 8845368fb..e3f99c08d 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -113,6 +113,11 @@ update_error_state(vpx_codec_alg_priv_t *ctx, ERROR(#memb " out of range ["#lo".."#hi"]");\ } while(0) +#define RANGE_CHECK_HI(p,memb,hi) do {\ + if(!((p)->memb <= (hi))) \ + ERROR(#memb " out of range [.."#hi"]");\ + } while(0) + #define RANGE_CHECK_LO(p,memb,lo) do {\ if(!((p)->memb >= (lo))) \ ERROR(#memb " out of range ["#lo"..]");\ @@ -130,24 +135,24 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, RANGE_CHECK(cfg, g_h, 2, 16384); RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den); - RANGE_CHECK(cfg, g_profile, 0, 3); - RANGE_CHECK(cfg, rc_min_quantizer, 0, 63); - RANGE_CHECK(cfg, rc_max_quantizer, 0, 63); - RANGE_CHECK(cfg, g_threads, 0, 64); + RANGE_CHECK_HI(cfg, g_profile, 3); + RANGE_CHECK_HI(cfg, rc_min_quantizer, 63); + RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); + RANGE_CHECK_HI(cfg, g_threads, 64); #if !(CONFIG_REALTIME_ONLY) - RANGE_CHECK(cfg, g_lag_in_frames, 0, 25); + RANGE_CHECK_HI(cfg, g_lag_in_frames, 25); #else - RANGE_CHECK(cfg, g_lag_in_frames, 0, 0); + RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); #endif RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_CBR); - RANGE_CHECK(cfg, rc_undershoot_pct, 0, 100); - RANGE_CHECK(cfg, rc_2pass_vbr_bias_pct, 0, 100); + RANGE_CHECK_HI(cfg, rc_undershoot_pct, 100); + RANGE_CHECK_HI(cfg, rc_2pass_vbr_bias_pct, 100); RANGE_CHECK(cfg, kf_mode, VPX_KF_DISABLED, VPX_KF_AUTO); //RANGE_CHECK_BOOL(cfg, g_delete_firstpassfile); RANGE_CHECK_BOOL(cfg, rc_resize_allowed); - RANGE_CHECK(cfg, rc_dropframe_thresh, 0, 100); - RANGE_CHECK(cfg, rc_resize_up_thresh, 0, 100); - RANGE_CHECK(cfg, rc_resize_down_thresh, 0, 100); + RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100); + RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100); + RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100); #if !(CONFIG_REALTIME_ONLY) RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS); #else @@ -166,7 +171,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, #if !(CONFIG_REALTIME_ONLY) RANGE_CHECK(vp8_cfg, encoding_mode, VP8_BEST_QUALITY_ENCODING, VP8_REAL_TIME_ENCODING); RANGE_CHECK(vp8_cfg, cpu_used, -16, 16); - RANGE_CHECK(vp8_cfg, noise_sensitivity, 0, 6); + RANGE_CHECK_HI(vp8_cfg, noise_sensitivity, 6); #else RANGE_CHECK(vp8_cfg, encoding_mode, VP8_REAL_TIME_ENCODING, VP8_REAL_TIME_ENCODING); @@ -177,10 +182,10 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, #endif RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION); - RANGE_CHECK(vp8_cfg, Sharpness, 0, 7); - RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15); - RANGE_CHECK(vp8_cfg, arnr_strength, 0, 6); - RANGE_CHECK(vp8_cfg, arnr_type, 0, 0xffffffff); + RANGE_CHECK_HI(vp8_cfg, Sharpness, 7); + RANGE_CHECK_HI(vp8_cfg, arnr_max_frames, 15); + RANGE_CHECK_HI(vp8_cfg, arnr_strength, 6); + RANGE_CHECK_HI(vp8_cfg, arnr_type, 0xffffffff); if (cfg->g_pass == VPX_RC_LAST_PASS) { -- cgit v1.2.3 From fa7a55bb043a6abfc661a8d06a2611b54372fe1c Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Tue, 21 Sep 2010 10:35:52 -0400 Subject: Add getter functions for the interface data symbols Having these symbols be available as functions rather than data is occasionally more convenient. Implemented this way rather than a get-codec-by-id style to avoid creating a link-time dependency between the encoder and the decoder. Fixes issue #169 Change-Id: I319f281277033a5e7e3ee3b092b9a87cce2f463d --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index e3f99c08d..f8a4de85b 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -1079,7 +1079,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] = #ifndef VERSION_STRING #define VERSION_STRING #endif -vpx_codec_iface_t vpx_codec_vp8_cx_algo = +CODEC_INTERFACE(vpx_codec_vp8_cx) = { "WebM Project VP8 Encoder" VERSION_STRING, VPX_CODEC_INTERNAL_ABI_VERSION, -- cgit v1.2.3 From 8ee7284d604a25838e71636b9cd4a16d53a2555e Mon Sep 17 00:00:00 2001 From: Adrian Grange Date: Thu, 30 Sep 2010 10:06:09 +0100 Subject: Changed defaults & range checking for AltRef params Modified the range checking of parameters used in the AltRef temporal filter (arnr-max-frames, arnr-strength, arnr-type) and default values for each of them. Change-Id: Ib261028d501b9523f6e44cb4790cc52167b6e92b --- vp8/vp8_cx_iface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index f8a4de85b..a6cb27b93 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -63,9 +63,9 @@ static const struct extraconfig_map extracfg_map[] = 0, /* Sharpness */ 0, /* static_thresh */ VP8_ONE_TOKENPARTITION, /* token_partitions */ - 0, /* arnr_max_frames */ - 0, /* arnr_strength */ - 0, /* arnr_type*/ + 0, /* arnr_max_frames */ + 3, /* arnr_strength */ + 3, /* arnr_type*/ } } }; @@ -183,9 +183,9 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION); RANGE_CHECK_HI(vp8_cfg, Sharpness, 7); - RANGE_CHECK_HI(vp8_cfg, arnr_max_frames, 15); - RANGE_CHECK_HI(vp8_cfg, arnr_strength, 6); - RANGE_CHECK_HI(vp8_cfg, arnr_type, 0xffffffff); + RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15); + RANGE_CHECK(vp8_cfg, arnr_strength, 1, 6); + RANGE_CHECK(vp8_cfg, arnr_type, 1, 3); if (cfg->g_pass == VPX_RC_LAST_PASS) { -- cgit v1.2.3 From 15542721eed9f434b4d9c670d4184c566705bfb7 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Mon, 4 Oct 2010 21:12:22 -0400 Subject: Update arnr strength range form 1-6 to 0-6. Change-Id: I8eb49c56f7509f0a8074d440e8345b9e3344b85b --- vp8/vp8_cx_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index a6cb27b93..499bc503a 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -184,7 +184,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, RANGE_CHECK(vp8_cfg, token_partitions, VP8_ONE_TOKENPARTITION, VP8_EIGHT_TOKENPARTITION); RANGE_CHECK_HI(vp8_cfg, Sharpness, 7); RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15); - RANGE_CHECK(vp8_cfg, arnr_strength, 1, 6); + RANGE_CHECK_HI(vp8_cfg, arnr_strength, 6); RANGE_CHECK(vp8_cfg, arnr_type, 1, 3); if (cfg->g_pass == VPX_RC_LAST_PASS) -- cgit v1.2.3 From bb7dd5b1baed31b15c6d39fc0c8981b852518b71 Mon Sep 17 00:00:00 2001 From: John Koleszar Date: Thu, 14 Oct 2010 16:40:12 -0400 Subject: Move firstpass motion map to stats packet The first implementation of the firstpass motion map for motion compensated temporal filtering created a file, fpmotionmap.stt, in the current working directory. This was not safe for multiple encoder instances. This patch merges this data into the first pass stats packet interface, so that it is handled like the other (numerical) firstpass stats. The new stats packet is defined as follows: Numerical Stats (16 doubles) -- 128 bytes Motion Map -- 1 byte / Macroblock Padding -- to align packet to 8 bytes The fpmotionmap.stt file can still be generated for debugging purposes in the same way that the textual version of the stats are available (defining OUTPUT_FPF in firstpass.c) Change-Id: I083ffbfd95e7d6a42bb4039ba0e81f678c8183ca --- vp8/vp8_cx_iface.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 499bc503a..b4bb679b5 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -14,6 +14,7 @@ #include "vpx_version.h" #include "onyx_int.h" #include "vpx/vp8e.h" +#include "vp8/encoder/firstpass.h" #include "onyx.h" #include #include @@ -189,22 +190,25 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, if (cfg->g_pass == VPX_RC_LAST_PASS) { - int n_doubles = cfg->rc_twopass_stats_in.sz / sizeof(double); - int n_packets = cfg->rc_twopass_stats_in.sz / sizeof(FIRSTPASS_STATS); - double frames; + int mb_r = (cfg->g_h + 15) / 16; + int mb_c = (cfg->g_w + 15) / 16; + size_t packet_sz = vp8_firstpass_stats_sz(mb_r * mb_c); + int n_packets = cfg->rc_twopass_stats_in.sz / packet_sz; + FIRSTPASS_STATS *stats; if (!cfg->rc_twopass_stats_in.buf) ERROR("rc_twopass_stats_in.buf not set."); - if (cfg->rc_twopass_stats_in.sz % sizeof(FIRSTPASS_STATS)) + if (cfg->rc_twopass_stats_in.sz % packet_sz) ERROR("rc_twopass_stats_in.sz indicates truncated packet."); - if (cfg->rc_twopass_stats_in.sz < 2 * sizeof(FIRSTPASS_STATS)) + if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) ERROR("rc_twopass_stats_in requires at least two packets."); - frames = ((double *)cfg->rc_twopass_stats_in.buf)[n_doubles - 1]; + stats = (void*)((char *)cfg->rc_twopass_stats_in.buf + + (n_packets - 1) * packet_sz); - if ((int)(frames + 0.5) != n_packets - 1) + if ((int)(stats->count + 0.5) != n_packets - 1) ERROR("rc_twopass_stats_in missing EOS stats packet"); } -- cgit v1.2.3 From 45e64941778058312d72711dbfcf039bb4ba5171 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Tue, 5 Oct 2010 17:46:37 -0400 Subject: Change altref times to preceding pts+1. Change the pts of the altref frame to be as close as possible to the pts of the preceding frame and still be strictly increasing. Change-Id: Iae3033a4c89ae5a9d0e5c4198e9196e5f3ee57c7 --- vp8/vp8_cx_iface.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vp8/vp8_cx_iface.c') diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index b4bb679b5..8e50b7f1b 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -763,12 +763,13 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx, { pkt.data.frame.flags |= VPX_FRAME_IS_INVISIBLE; - // TODO: ideally this timestamp should be as close as - // possible to the prior PTS so that if a decoder uses - // pts to schedule when to do this, we start right after - // last frame was decoded. Maybe should be set to - // last time stamp. Invisible frames have no duration.. - pkt.data.frame.pts --; + // This timestamp should be as close as possible to the + // prior PTS so that if a decoder uses pts to schedule when + // to do this, we start right after last frame was decoded. + // Invisible frames have no duration. + pkt.data.frame.pts = ((cpi->last_time_stamp_seen + * ctx->cfg.g_timebase.den + round) + / ctx->cfg.g_timebase.num / 10000000) + 1; pkt.data.frame.duration = 0; } -- cgit v1.2.3