]> granicus.if.org Git - libx264/commitdiff
Fix compilation of only 8 or 10 bit by a non-optimizing compiler
authorAnton Mitrofanov <BugMaster@narod.ru>
Sat, 28 Jan 2023 18:45:30 +0000 (21:45 +0300)
committerAnton Mitrofanov <BugMaster@narod.ru>
Sat, 28 Jan 2023 18:45:30 +0000 (21:45 +0300)
encoder/api.c
x264.c

index ac512182a7777f4c2377b2b7a8639cffd49563a5..afc385373f0cd62dbe1f7fe9402105dcd8f238c4 100644 (file)
@@ -79,7 +79,8 @@ REALIGN_STACK x264_t *x264_encoder_open( x264_param_t *param )
     if( !api )
         return NULL;
 
-    if( HAVE_BITDEPTH8 && param->i_bitdepth == 8 )
+#if HAVE_BITDEPTH8
+    if( param->i_bitdepth == 8 )
     {
         api->nal_encode = x264_8_nal_encode;
         api->encoder_reconfig = x264_8_encoder_reconfig;
@@ -94,7 +95,10 @@ REALIGN_STACK x264_t *x264_encoder_open( x264_param_t *param )
 
         api->x264 = x264_8_encoder_open( param, api );
     }
-    else if( HAVE_BITDEPTH10 && param->i_bitdepth == 10 )
+    else
+#endif
+#if HAVE_BITDEPTH10
+    if( param->i_bitdepth == 10 )
     {
         api->nal_encode = x264_10_nal_encode;
         api->encoder_reconfig = x264_10_encoder_reconfig;
@@ -110,6 +114,7 @@ REALIGN_STACK x264_t *x264_encoder_open( x264_param_t *param )
         api->x264 = x264_10_encoder_open( param, api );
     }
     else
+#endif
         x264_log_internal( X264_LOG_ERROR, "not compiled with %d bit depth support\n", param->i_bitdepth );
 
     if( !api->x264 )
diff --git a/x264.c b/x264.c
index c6845d428753d8fe18eb6c8f26fde239a099d836..5a8cb363ba4ecc5044452deaec4361a4e8abab03 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -1673,11 +1673,16 @@ generic_option:
     /* init threaded input while the information about the input video is unaltered by filtering */
 #if HAVE_THREAD
     const cli_input_t *thread_input;
-    if( HAVE_BITDEPTH8 && param->i_bitdepth == 8 )
+#if HAVE_BITDEPTH8
+    if( param->i_bitdepth == 8 )
         thread_input = &thread_8_input;
-    else if( HAVE_BITDEPTH10 && param->i_bitdepth == 10 )
+    else
+#endif
+#if HAVE_BITDEPTH10
+    if( param->i_bitdepth == 10 )
         thread_input = &thread_10_input;
     else
+#endif
         thread_input = NULL;
 
     if( thread_input && info.thread_safe && (b_thread_input || param->i_threads > 1