changeset 9515:e93986dd286c draft

Merge with public
author Praveen Tiwari <praveen@multicorewareinc.com>
date Mon, 16 Feb 2015 10:09:11 +0530
parents c98d0dccbb36 (current diff) 164bd8337e72 (diff)
children 369c6e503f92
files
diffstat 4 files changed, 14 insertions(+-), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/reST/presets.rst	Fri Feb 13 18:28:52 2015 +0530
+++ b/doc/reST/presets.rst	Mon Feb 16 10:09:11 2015 +0530
@@ -60,7 +60,7 @@ The presets adjust encoder parameters to
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | weightb      |    0      |     0     |    0     |   0    |  0   |    0   |  0   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
-| aq-mode      |    0      |     0     |    2     |   2    |  2   |    2   |  2   |   2    |    2     |    2    |
+| aq-mode      |    0      |     0     |    1     |   1    |  1   |    1   |  1   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | cuTree       |    0      |     0     |    0     |   0    |  1   |    1   |  1   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
--- a/source/common/common.cpp	Fri Feb 13 18:28:52 2015 +0530
+++ b/source/common/common.cpp	Mon Feb 16 10:09:11 2015 +0530
@@ -33,6 +33,10 @@
 #include <sys/time.h>
 #endif
 
+#if CHECKED_BUILD || _DEBUG
+int g_checkFailures;
+#endif
+
 int64_t x265_mdate(void)
 {
 #if _WIN32
--- a/source/common/common.h	Fri Feb 13 18:28:52 2015 +0530
+++ b/source/common/common.h	Mon Feb 16 10:09:11 2015 +0530
@@ -114,9 +114,10 @@ extern "C" intptr_t x265_stack_align(voi
 /* If compiled with CHECKED_BUILD perform run-time checks and log any that
  * fail, both to stderr and to a file */
 #if CHECKED_BUILD || _DEBUG
+extern int g_checkFailures;
 #define X265_CHECK(expr, ...) if (!(expr)) { \
     x265_log(NULL, X265_LOG_ERROR, __VA_ARGS__); \
-    DEBUG_BREAK(); \
+    DEBUG_BREAK(); g_checkFailures++; \
     FILE *fp = fopen("x265_check_failures.txt", "a"); \
     if (fp) { fprintf(fp, "%s:%d\n", __FILE__, __LINE__); fprintf(fp, __VA_ARGS__); fclose(fp); } \
 }
--- a/source/encoder/encoder.cpp	Fri Feb 13 18:28:52 2015 +0530
+++ b/source/encoder/encoder.cpp	Mon Feb 16 10:09:11 2015 +0530
@@ -365,6 +365,13 @@ void Encoder::updateVbvPlan(RateControl*
  *         negative on malloc error or abort */
 int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
 {
+#if CHECKED_BUILD || _DEBUG
+    if (g_checkFailures)
+    {
+        x265_log(m_param, X265_LOG_ERROR, "encoder aborting because of internal error\n");
+        return -1;
+    }
+#endif
     if (m_aborted)
         return -1;