Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.