Skip to content

Instantly share code, notes, and snippets.

@SAPikachu
Created August 1, 2011 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SAPikachu/1117711 to your computer and use it in GitHub Desktop.
Save SAPikachu/1117711 to your computer and use it in GitHub Desktop.
x264 avisynth 16bit hack
input/avs.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/input/avs.c b/input/avs.c
index 59fab8c..373fa68 100644
--- a/input/avs.c
+++ b/input/avs.c
@@ -267,6 +267,14 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
info->csp = X264_CSP_NONE;
info->vfr = 0;
+ if( opt->bit_depth > 8 )
+ {
+ FAIL_IF_ERROR( info->width & 3, "avisynth 16bit hack requires that width is at least mod4\n" )
+ x264_cli_log( "avs", X264_LOG_INFO, "avisynth 16bit hack enabled\n" );
+ info->csp |= X264_CSP_HIGH_DEPTH;
+ info->width >>= 1;
+ }
+
*p_handle = h;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment