Commit a296ffcc authored by Loren Merritt's avatar Loren Merritt

VFW: 8x8 transform, SAR.

patch by celtic_druid.


git-svn-id: svn://svn.videolan.org/x264/trunk@260 df754926-b1dd-0310-bc7b-ec298dee348c
parent 7832f017
......@@ -207,8 +207,6 @@ LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiO
codec->hCons = ( HWND * )param.p_log_private;
param.analyse.b_psnr = 0;
param.analyse.inter = 0;
param.analyse.intra = X264_ANALYSE_I4x4;
/* Set params: TODO to complete */
param.i_width = lpbiInput->bmiHeader.biWidth;
......@@ -225,6 +223,8 @@ LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiO
param.rc.f_ip_factor = 1 + (float)config->i_key_boost / 100;
param.rc.f_pb_factor = 1 + (float)config->i_b_red / 100;
param.rc.f_qcompress = (float)config->i_curve_comp / 100;
param.vui.i_sar_width = config->i_sar_width;
param.vui.i_sar_height = config->i_sar_height;
param.i_bframe = config->i_bframe;
if( config->i_bframe > 1 && config->b_b_wpred)
......@@ -241,6 +241,7 @@ LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiO
param.i_deblocking_filter_alphac0 = config->i_inloop_a;
param.i_deblocking_filter_beta = config->i_inloop_a;
param.analyse.inter = 0;
if( config->b_bsub16x16 )
param.analyse.inter |= X264_ANALYSE_BSUB16x16;
if( config->b_psub16x16 )
......@@ -251,6 +252,10 @@ LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiO
}
if( config->b_i4x4 )
param.analyse.inter |= X264_ANALYSE_I4x4;
if( config->b_i8x8 )
param.analyse.inter |= X264_ANALYSE_I8x8;
param.analyse.b_transform_8x8 = config->b_dct8x8;
switch( config->i_encoding_type )
{
......
......@@ -97,9 +97,13 @@ static const reg_int_t reg_int_table[] =
{ "key_boost", &reg.i_key_boost, 40 },
{ "b_red", &reg.i_b_red, 30 },
{ "curve_comp", &reg.i_curve_comp, 60 },
{ "sar_width", &reg.i_sar_width, 1 },
{ "sar_height", &reg.i_sar_height, 1 },
/* analysis */
{ "i4x4", &reg.b_i4x4, 1 },
{ "i8x8", &reg.b_i8x8, 1 },
{ "dct8x8", &reg.b_dct8x8, 1 },
{ "psub16x16", &reg.b_psub16x16, 1 },
{ "psub8x8", &reg.b_psub8x8, 1 },
{ "bsub16x16", &reg.b_bsub16x16, 1 },
......@@ -546,11 +550,19 @@ static void adv_update_dlg( HWND hDlg, CONFIG * config )
config->b_bsub16x16 ? BST_CHECKED: BST_UNCHECKED );
CheckDlgButton( hDlg,IDC_I4X4,
config->b_i4x4 ? BST_CHECKED: BST_UNCHECKED );
CheckDlgButton( hDlg,IDC_I8X8,
config->b_i8x8 ? BST_CHECKED: BST_UNCHECKED );
CheckDlgButton( hDlg,IDC_DCT8X8,
config->b_dct8x8 ? BST_CHECKED: BST_UNCHECKED );
SetDlgItemInt( hDlg, IDC_KEYINTMIN, config->i_keyint_min, FALSE );
SetDlgItemInt( hDlg, IDC_KEYINTMAX, config->i_keyint_max, FALSE );
SetDlgItemInt( hDlg, IDC_REFFRAMES, config->i_refmax, FALSE );
SetDlgItemInt( hDlg, IDC_BFRAME, config->i_bframe, FALSE );
SetDlgItemInt( hDlg, IDC_SAR_W, config->i_sar_width, FALSE );
SetDlgItemInt( hDlg, IDC_SAR_H, config->i_sar_height, FALSE );
SetDlgItemInt( hDlg, IDC_IPRATIO, config->i_key_boost, FALSE );
SetDlgItemInt( hDlg, IDC_PBRATIO, config->i_b_red, FALSE );
SetDlgItemInt( hDlg, IDC_CURVECOMP, config->i_curve_comp, FALSE );
......@@ -568,6 +580,7 @@ static void adv_update_dlg( HWND hDlg, CONFIG * config )
EnableWindow( GetDlgItem( hDlg, IDC_BREFS ), config->i_bframe > 1 );
EnableWindow( GetDlgItem( hDlg, IDC_WBPRED ), config->i_bframe > 1 );
EnableWindow( GetDlgItem( hDlg, IDC_DIRECTPRED ), config->i_bframe > 0 );
EnableWindow( GetDlgItem( hDlg, IDC_I8X8 ), config->b_dct8x8 );
memcpy( fourcc, config->fcc, 4 );
fourcc[4] = '\0';
......@@ -622,6 +635,13 @@ BOOL CALLBACK callback_advanced( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_I4X4 :
config->b_i4x4 = ( IsDlgButtonChecked( hDlg, IDC_I4X4 ) == BST_CHECKED );
break;
case IDC_I8X8 :
config->b_i8x8 = ( IsDlgButtonChecked( hDlg, IDC_I8X8 ) == BST_CHECKED );
break;
case IDC_DCT8X8 :
config->b_dct8x8 = ( IsDlgButtonChecked( hDlg, IDC_DCT8X8 ) == BST_CHECKED );
EnableWindow( GetDlgItem( hDlg, IDC_I8X8 ), config->b_dct8x8 );
break;
}
break;
case EN_CHANGE :
......@@ -633,6 +653,12 @@ BOOL CALLBACK callback_advanced( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
case IDC_KEYINTMAX :
config->i_keyint_max = GetDlgItemInt( hDlg, IDC_KEYINTMAX, FALSE, FALSE );
break;
case IDC_SAR_W :
config->i_sar_width = GetDlgItemInt( hDlg, IDC_SAR_W, FALSE, FALSE );
break;
case IDC_SAR_H :
config->i_sar_height = GetDlgItemInt( hDlg, IDC_SAR_H, FALSE, FALSE );
break;
case IDC_REFFRAMES :
config->i_refmax = GetDlgItemInt( hDlg, IDC_REFFRAMES, FALSE, FALSE );
if( config->i_refmax > 16 )
......
......@@ -68,6 +68,10 @@
#define IDC_WBPRED 1059
#define IDC_THREADS 1060
#define IDC_THREADEDIT 1061
#define IDC_SAR_W 1062
#define IDC_SAR_H 1063
#define IDC_I8X8 1064
#define IDC_DCT8X8 1065
// Next default values for new objects
//
......@@ -75,7 +79,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1062
#define _APS_NEXT_CONTROL_VALUE 1066
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
......@@ -107,12 +107,12 @@ BEGIN
EDITTEXT IDC_THREADEDIT,52,211,19,14,ES_AUTOHSCROLL | ES_NUMBER
END
IDD_ADVANCED DIALOG DISCARDABLE 0, 0, 302, 267
IDD_ADVANCED DIALOG DISCARDABLE 0, 0, 302, 306
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "x264 Advanced Settings"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,245,250,50,14
DEFPUSHBUTTON "OK",IDOK,245,290,50,14
GROUPBOX "H.264 Features",IDC_STATIC,7,7,145,88
CONTROL "CABAC",IDC_CABAC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
16,23,61,10
......@@ -135,7 +135,7 @@ BEGIN
WS_TABSTOP,168,64,80,10
CONTROL "Weighted biprediction",IDC_WBPRED,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,168,79,82,10
GROUPBOX "More Encoder Settings",IDC_STATIC,7,98,145,74
GROUPBOX "More Encoder Settings",IDC_STATIC,7,98,145,107
LTEXT "Max IDR-frame interval:",IDC_STATIC,16,113,95,8
EDITTEXT IDC_KEYINTMAX,114,110,25,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Min IDR-frame interval:",IDC_STATIC,16,133,90,8
......@@ -149,18 +149,26 @@ BEGIN
EDITTEXT IDC_PBRATIO,258,130,25,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Bitrate variability (%):",IDC_STATIC,168,153,75,8
EDITTEXT IDC_CURVECOMP,258,150,25,14,ES_AUTOHSCROLL | ES_NUMBER
GROUPBOX "Macroblock Partitions",IDC_STATIC,7,174,288,73
GROUPBOX "Macroblock Partitions",IDC_STATIC,7,210,288,73
CONTROL "8x16, 16x8 and 8x8 P-frame search",IDC_P16X16,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,190,127,10
BS_AUTOCHECKBOX | WS_TABSTOP,17,226,127,10
CONTROL "4x8, 8x4 and 4x4 P-frame search",IDC_P8X8,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,165,190,119,10
BS_AUTOCHECKBOX | WS_TABSTOP,165,226,119,10
CONTROL "8x16, 16x8 and 8x8 B-frame search",IDC_B16X16,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,17,206,127,10
BS_AUTOCHECKBOX | WS_TABSTOP,17,242,127,10
CONTROL "4x4 Intra search",IDC_I4X4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,165,206,82,10
LTEXT "Partition decision quality:",IDC_STATIC,17,227,95,8
COMBOBOX IDC_SUBPEL,104,225,70,77,CBS_DROPDOWNLIST | CBS_SORT |
WS_TABSTOP,165,242,82,10
LTEXT "Partition decision quality:",IDC_STATIC,128,263,80,8
COMBOBOX IDC_SUBPEL,215,261,70,77,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_SAR_W,84,170,21,14,ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_SAR_H,118,170,21,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Pixel Aspect Ratio",IDC_STATIC,16,172,58,8
LTEXT ":",IDC_STATIC,109,172,8,8
CONTROL "8x8 Intra search",IDC_I8X8,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,17,257,67,10
CONTROL "8x8 DCT",IDC_DCT8X8,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,17,270,44,10
END
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 213, 130
......@@ -207,7 +215,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 295
TOPMARGIN, 7
BOTTOMMARGIN, 251
BOTTOMMARGIN, 290
END
IDD_ABOUT, DIALOG
......
......@@ -56,10 +56,12 @@ typedef struct
int b_cabac;
int b_i8x8;
int b_i4x4;
int b_psub16x16;
int b_psub8x8;
int b_bsub16x16;
int b_dct8x8;
int i_bframe;
int i_subpel_refine;
......@@ -75,6 +77,9 @@ typedef struct
int i_b_red;
int i_curve_comp;
int i_sar_width;
int i_sar_height;
/* vfw interface */
int b_save;
/* fourcc used */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment