From 0f84192e88d6adc4512f6f320a50a09b4608634c Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Tue, 3 Feb 2015 14:51:28 +0300 Subject: [PATCH] Add tile format frame packing value Defined in 2014-02 edition. --- encoder/encoder.c | 11 ++++++++++- x264.c | 3 ++- x264.h | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/encoder/encoder.c b/encoder/encoder.c index b0a47a86..dffa3560 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -591,11 +591,20 @@ static int x264_validate_parameters( x264_t *h, int b_open ) h->param.i_dpb_size = 1; } - if( h->param.i_frame_packing < -1 || h->param.i_frame_packing > 6 ) + if( h->param.i_frame_packing < -1 || h->param.i_frame_packing > 7 ) { x264_log( h, X264_LOG_WARNING, "ignoring unknown frame packing value\n" ); h->param.i_frame_packing = -1; } + if( h->param.i_frame_packing == 7 && + ((h->param.i_width - h->param.crop_rect.i_left - h->param.crop_rect.i_right) % 3 || + (h->param.i_height - h->param.crop_rect.i_top - h->param.crop_rect.i_bottom) % 3) ) + { + x264_log( h, X264_LOG_ERROR, "cropped resolution %dx%d not compatible with tile format frame packing\n", + h->param.i_width - h->param.crop_rect.i_left - h->param.crop_rect.i_right, + h->param.i_height - h->param.crop_rect.i_top - h->param.crop_rect.i_bottom ); + return -1; + } /* Detect default ffmpeg settings and terminate with an error. */ if( b_open ) diff --git a/x264.c b/x264.c index df15e04f..5c3df0f9 100644 --- a/x264.c +++ b/x264.c @@ -704,7 +704,8 @@ static void help( x264_param_t *defaults, int longhelp ) " - 3: side by side - L is on the left, R on the right\n" " - 4: top bottom - L is on top, R on bottom\n" " - 5: frame alternation - one view per frame\n" - " - 6: mono - 2D frame without any frame packing\n" ); + " - 6: mono - 2D frame without any frame packing\n" + " - 7: tile format - L is on top-left, R split across\n" ); H0( "\n" ); H0( "Ratecontrol:\n" ); H0( "\n" ); diff --git a/x264.h b/x264.h index 612d0488..7cc5fccf 100644 --- a/x264.h +++ b/x264.h @@ -41,7 +41,7 @@ #include "x264_config.h" -#define X264_BUILD 145 +#define X264_BUILD 146 /* Application developers planning to link against a shared library version of * libx264 from a Microsoft Visual Studio or similar development environment -- 2.39.2