Results Polishing
Implemented clearing of results for invalid input Added protections for out of range refresh frequencies in GTF, CVT, CVT-RB, and CVT-R2 Added proper V refresh results for interlaced scan Fixed interlanced blanking calculations for 'None' timing format option Removed mock placeholder values in Results
This commit is contained in:
parent
20bb45b82c
commit
6fa887e78a
@ -6,6 +6,7 @@ function SI(value, unit, options_input) {
|
||||
['mode', 'f'],
|
||||
['p', '2'],
|
||||
//['exclude', ['c', 'd', 'D', 'H']],
|
||||
['round', 'n'],
|
||||
['exclude', []],
|
||||
['include', []],
|
||||
|
||||
@ -31,28 +32,45 @@ function SI(value, unit, options_input) {
|
||||
mode: 'f' Precision mode (default Fixed mode). Options are:
|
||||
'fixed' or 'f' Uses a fixed number of decimal places, specified by precision field
|
||||
'sig' or 's' Targets a fixed number of significant figures.
|
||||
'adaptive' or 'a' Uses up to a certain number of decimal points, but leaves no trailing zeroes when not needed.
|
||||
'adaptive' or 'a' Uses up to the specified number of decimal points, but leaves no trailing zeroes when not needed.
|
||||
p: 2 Specifies default precision (number of decimal places).
|
||||
For adaptive mode, it may be specified in the format "[2, 5]" to indicate minimum and maximum precision. A single number will be interpreted as a maximum.
|
||||
Also accepts individual decimal place settings for each prefix, in array format; for example:
|
||||
{p: [1, G2, M0]} sets a default of 1 for all prefixes, then specifies 2 decimal places for Giga and 0 for Mega.
|
||||
That can alternatively be written as powers:
|
||||
That can alternatively be written using powers instead of prefix symbols:
|
||||
{p: [1, [9, 2], [6, 0]]}
|
||||
round: Options:
|
||||
n Rounds to nearest (default)
|
||||
+ Rounds toward positive infinity (ceil) (1.9 -> 2; -1.9 -> 1)
|
||||
- Rounds toward negative infinity (floor) (1.9 -> 1; -1.9 -> -2)
|
||||
0 Rounds toward zero (truncate) (1.9 -> 1; -1.9 -> 1)
|
||||
!0 Rounds away from zero (1.9 -> 2; -1.9 -> -2)
|
||||
Also accepted:
|
||||
up Same as +
|
||||
ceil Same as +
|
||||
+inf Same as +
|
||||
|
||||
separator: ',' Character to use as thousands separator (default comma)
|
||||
decimal: '.' Character to use as decimal point (default period)
|
||||
unit_sep: ' ' Character to place between the value and unit symbol (default non-breaking space)
|
||||
big_kilo: 'true' Use capital K for kilo instead of small k. (default false)
|
||||
no_mu: 'true' Use "u" instead of "µ" on output, if necessary for compatibility reasons (default false)
|
||||
threshold: 1000 Point at which to use the next
|
||||
down Same as -
|
||||
floor Same as -
|
||||
-inf Same as -
|
||||
|
||||
zero Same as 0
|
||||
!zero Same as !0
|
||||
|
||||
|
||||
grouper: ',' Character to use for digit grouping (default comma); space is interpreted as Non-Breaking Thin Space (U+2009)
|
||||
radix: '.' Character to use as decimal point (default period); error if same as grouper
|
||||
unit_sep: ' ' Character to place between the value and unit symbol (default Non-Breaking Space (U+00A0))
|
||||
big_kilo: 'false' Use capital K for kilo instead of small k. (default false)
|
||||
no_mu: 'false' Use "u" instead of "µ" on output, if necessary for compatibility reasons (default false)
|
||||
threshold: 0 Point at which to use the next prefix (represeted by power). For example, if Threshold is set to 2, then
|
||||
number must be at 100,000,000 to use the Mega prefix (>= 10^2 times the prefix value). 0 for normal behavior.
|
||||
|
||||
exclude: ['c', 'd'] SI prefixes to exclude, for situational use (i.e. for displaying time, one may not wish for "centiseconds").
|
||||
Symbols can also be used as shortcuts, as in the following examples:
|
||||
'>=G' excludes Giga and larger
|
||||
'>G' excludes larger than Giga, but not Giga itself
|
||||
'<G' and "<=G" same as above, but for prefixes smaller than Giga
|
||||
'*' excludes all prefixes (unless protected)
|
||||
'!G' protects a prefix from '*', i.e. {exclude: ['*', '!k', '!M']} excludes all prefixes except Kilo and Mega)
|
||||
Multiple arguments accepted in array format
|
||||
"u" is accepted as an argument for excluding "µ", and "0" is accepted for excluding the prefixless base unit
|
||||
By default, the following are excluded already, and must be un-excluded (using !c, !d, etc.) to be used:
|
||||
|
@ -44,7 +44,7 @@ var Detailed_Explanation = {
|
||||
'<li><b>Pixels per frame</b> is the effective number of total pixels (horizontal resolution times vertical resolution), including both active and blank pixels</li>' +
|
||||
'<li><b>Frames per second</b> is the vertical refresh frequency (for progressive scan) or half the vertical field rate (for interlaced scan)</li></ul>' +
|
||||
'The data rate for YC<sub>B</sub>C<sub>R</sub> 4:4:4 video is the same as RGB. ' +
|
||||
'For YC<sub>B</sub>C<sub>R</sub> 4:2:2 video, the data rate is divided by 1.5. For YC<sub>B</sub>C<sub>R</sub> 4:2:0 the data rate is divided by 2.<br><br>' +
|
||||
'For YC<sub>B</sub>C<sub>R</sub> 4:2:2 video, the data rate is divided by 1.5. For YC<sub>B</sub>C<sub>R</sub> 4:2:0, the data rate is divided by 2.<br><br>' +
|
||||
'The total <b>bandwidth</b> required for video transmission is larger than the data rate, due to additional overhead involved with transmission.',
|
||||
|
||||
'results_bit_rate':
|
||||
@ -151,24 +151,15 @@ var Detailed_Explanation = {
|
||||
'results_v_field':
|
||||
'',
|
||||
|
||||
'results_v_field_actual':
|
||||
'',
|
||||
|
||||
'results_v_field_dev':
|
||||
'',
|
||||
|
||||
'results_v_field_dev_perc':
|
||||
'',
|
||||
|
||||
'results_v_framerate':
|
||||
'',
|
||||
|
||||
'results_v_framerate_actual':
|
||||
'',
|
||||
|
||||
'results_v_framerate_dev':
|
||||
'',
|
||||
|
||||
'results_v_framerate_dev_perc':
|
||||
'',
|
||||
|
||||
'results_v_field_per':
|
||||
'',
|
||||
|
||||
@ -181,6 +172,30 @@ var Detailed_Explanation = {
|
||||
'results_v_field_per_dev_perc':
|
||||
'',
|
||||
|
||||
'results_v_frame':
|
||||
'',
|
||||
|
||||
'results_v_frame_actual':
|
||||
'',
|
||||
|
||||
'results_v_frame_dev':
|
||||
'',
|
||||
|
||||
'results_v_frame_dev_perc':
|
||||
'',
|
||||
|
||||
'results_v_frame_per':
|
||||
'',
|
||||
|
||||
'results_v_frame_per_actual':
|
||||
'',
|
||||
|
||||
'results_v_frame_per_dev':
|
||||
'',
|
||||
|
||||
'results_v_frame_per_dev_perc':
|
||||
'',
|
||||
|
||||
'results_h_refresh':
|
||||
'',
|
||||
|
||||
|
@ -441,7 +441,7 @@ function calcMain() {
|
||||
if(Global_InputVars['V_SW_INT'] == '') { submitVar('V_SW_INT') }
|
||||
*/
|
||||
|
||||
if (!input_ok()) { clearResults(); return; }
|
||||
if (!input_ok()) { clearResults(); $('#TIMING_FORMAT_NAME').html(''); return; }
|
||||
|
||||
var hres = Global_InputVars['HRES'];
|
||||
var vres = Global_InputVars['VRES'];
|
||||
@ -462,43 +462,9 @@ function calcMain() {
|
||||
var v_eff = Timing['V_EFF'] * scan
|
||||
var freq_act = Timing['F_ACTUAL'];
|
||||
|
||||
/*
|
||||
var results = {
|
||||
hres: hres,
|
||||
vres: vres,
|
||||
freq: freq,
|
||||
px_bits: color_depth,
|
||||
px_format: px_format,
|
||||
comp: comp,
|
||||
scan: scan,
|
||||
|
||||
Timing: Timing,
|
||||
|
||||
// Calculate results
|
||||
// Resolution with blanking intervals
|
||||
h_eff: Timing['H_EFF'],
|
||||
v_eff: Timing['V_EFF'],
|
||||
|
||||
// Aspect ratio
|
||||
ratio_num: hres / vres,
|
||||
ratio_str: (hres / GCD(hres, vres)) + ':' + (vres / GCD(hres, vres)),
|
||||
|
||||
// Total pixel count of image
|
||||
px_per_frame: hres * vres,
|
||||
px_per_frame_eff: (Timing['H_EFF']) * (Timing['V_EFF']),
|
||||
|
||||
// Size (bits) of one frame
|
||||
bits_per_frame: hres * vres * color_depth,
|
||||
bits_per_frame_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * color_depth,
|
||||
|
||||
// Pixel clock
|
||||
px_per_sec: hres * vres * Timing['F_ACTUAL'],
|
||||
px_per_sec_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * Timing['F_ACTUAL'],
|
||||
|
||||
// Raw bit rate
|
||||
bits_per_sec_eff: (Timing['H_EFF']) * (Timing['V_EFF']) * color_depth * Timing['F_ACTUAL'],
|
||||
};*/
|
||||
// DATA TRANSMISSION
|
||||
|
||||
{
|
||||
Detailed_Results['data_rate'] = SI(
|
||||
(h_eff * v_eff * freq_act * color_depth / px_format / scan / comp),
|
||||
'bit/s',
|
||||
@ -528,37 +494,45 @@ function calcMain() {
|
||||
'px/s',
|
||||
{'p':[3, 'b1', 'k1', 'M1'], 'output':'split'},
|
||||
);
|
||||
|
||||
Detailed_Results['active_px'] = {
|
||||
'h': hres,
|
||||
'v': vres,
|
||||
't': SI(hres * vres, 'px', {'p':0, 'output':'split', 'include': ['b']}),
|
||||
}
|
||||
|
||||
// RESOLUTION
|
||||
|
||||
{
|
||||
Detailed_Results['active_px'] = {
|
||||
'h': { 'val': hres },
|
||||
'v': { 'val': vres },
|
||||
't': SI(hres * vres, 'px', {'p':0, 'output':'split', 'include': ['b']}),
|
||||
};
|
||||
|
||||
Detailed_Results['blank_px'] = {
|
||||
'h': h_eff - hres,
|
||||
'v': v_eff - vres,
|
||||
'h': { 'val': h_eff - hres },
|
||||
'v': { 'val': v_eff - vres },
|
||||
't': SI((h_eff * v_eff) - (hres * vres), 'px', {'p':0, 'output':'split', 'include': ['b']}),
|
||||
}
|
||||
};
|
||||
|
||||
Detailed_Results['total_px'] = {
|
||||
'h': h_eff,
|
||||
'v': v_eff,
|
||||
'h': { 'val': h_eff },
|
||||
'v': { 'val': v_eff },
|
||||
't': SI(h_eff * v_eff, 'px', {'p':0, 'output':'split', 'exclude': ['<B', '>B']}),
|
||||
}
|
||||
};
|
||||
|
||||
Detailed_Results['overhead_px'] = {
|
||||
'h': SI(100 * ((h_eff / hres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['<B', '>B']}),
|
||||
'v': SI(100 * ((v_eff / vres) - 1), '%', {'p':2, 'output':'split', 'exclude': ['<B', '>B']}),
|
||||
't': SI(100 * (((h_eff * v_eff) / (hres * vres)) - 1), '%', {'p':2, 'output':'split', 'exclude': ['<B', '>B']}),
|
||||
};
|
||||
}
|
||||
|
||||
// FORMAT
|
||||
|
||||
{
|
||||
if ($('input[name=COLOR_DEPTH_SLCT]:checked').val() == 'Custom') {
|
||||
if (color_depth % 3 == 0) { Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' }; }
|
||||
else { Detailed_Results['bpc'] = { 'val': '-', 'unit': '' }; }
|
||||
}
|
||||
else {
|
||||
Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' }
|
||||
Detailed_Results['bpc'] = { 'val': color_depth / 3, 'unit':'bpc' };
|
||||
}
|
||||
Detailed_Results['bpp'] = { 'val': color_depth, 'unit': 'bit/px' };
|
||||
|
||||
@ -571,7 +545,11 @@ function calcMain() {
|
||||
|
||||
if (scan == 1) { Detailed_Results['scan'] = 'Progressive'; }
|
||||
if (scan == 2) { Detailed_Results['scan'] = 'Interlaced'; }
|
||||
}
|
||||
|
||||
// VERTICAL REFRESH FOR PROGRESSIVE SCAN
|
||||
|
||||
{
|
||||
Detailed_Results['v_freq'] = SI(
|
||||
freq,
|
||||
'Hz',
|
||||
@ -579,22 +557,19 @@ function calcMain() {
|
||||
);
|
||||
|
||||
Detailed_Results['v_freq_actual'] = SI(
|
||||
Timing['F_ACTUAL'],
|
||||
freq_act,
|
||||
'Hz',
|
||||
{'p':3, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
DEBUG('freq:', typeof(freq), freq)
|
||||
DEBUG('f_actual', typeof(Timing['F_ACTUAL']), Timing['F_ACTUAL'])
|
||||
DEBUG('f - fa', freq - Timing['F_ACTUAL'])
|
||||
Detailed_Results['v_freq_dev'] = SI(
|
||||
Math.abs(freq - Timing['F_ACTUAL']),
|
||||
Math.abs(freq - freq_act),
|
||||
'Hz',
|
||||
{'p':6, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_freq_dev_perc'] = SI(
|
||||
Math.abs(100 * ((freq - Timing['F_ACTUAL']) / freq)),
|
||||
Math.abs(100 * ((freq - freq_act) / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
@ -606,34 +581,138 @@ function calcMain() {
|
||||
);
|
||||
|
||||
Detailed_Results['v_per_actual'] = SI(
|
||||
1 / Timing['F_ACTUAL'],
|
||||
1 / freq_act,
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_per_dev'] = SI(
|
||||
Math.abs((1 / freq) - (1 / Timing['F_ACTUAL'])),
|
||||
Math.abs((1 / freq) - (1 / freq_act)),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_per_dev_perc'] = SI(
|
||||
Math.abs(100 * ((1 / freq) - (1 / Timing['F_ACTUAL'])) / (1 / freq)),
|
||||
Math.abs(100 * ((1 / freq) - (1 / freq_act)) / (1 / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
}
|
||||
|
||||
// VERTICAL REFRESH FOR INTERLACED SCAN
|
||||
|
||||
{
|
||||
Detailed_Results['v_field'] = SI(
|
||||
freq,
|
||||
'Hz',
|
||||
{'p':3, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_actual'] = SI(
|
||||
Timing['F_ACTUAL'],
|
||||
'Hz',
|
||||
{'p':3, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_dev'] = SI(
|
||||
Math.abs(freq - freq_act),
|
||||
'Hz',
|
||||
{'p':6, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_dev_perc'] = SI(
|
||||
Math.abs(100 * ((freq - freq_act) / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_per'] = SI(
|
||||
1 / freq,
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_per_actual'] = SI(
|
||||
1 / freq_act,
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_per_dev'] = SI(
|
||||
Math.abs((1 / freq) - (1 / freq_act)),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_field_per_dev_perc'] = SI(
|
||||
Math.abs(100 * ((1 / freq) - (1 / freq_act)) / (1 / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame'] = SI(
|
||||
freq / 2,
|
||||
'FPS',
|
||||
{'p':3, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_actual'] = SI(
|
||||
freq_act / 2,
|
||||
'FPS',
|
||||
{'p':3, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_dev'] = SI(
|
||||
Math.abs((freq / 2) - (freq_act / 2)),
|
||||
'FPS',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_dev_perc'] = SI(
|
||||
Math.abs(100 * ((freq - freq_act) / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_per'] = SI(
|
||||
(1 / (freq / 2)),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_per_actual'] = SI(
|
||||
1 / (freq_act / 2),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_per_dev'] = SI(
|
||||
Math.abs((2 / freq) - (2 / freq_act)),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['v_frame_per_dev_perc'] = SI(
|
||||
Math.abs(100 * ((2 / freq) - (2 / freq_act)) / (2 / freq)),
|
||||
'%',
|
||||
{'p':6, 'output':'split', 'include':['b']},
|
||||
);
|
||||
}
|
||||
|
||||
// HORIZONTAL REFRESH
|
||||
{
|
||||
Detailed_Results['h_freq'] = SI(
|
||||
(v_eff * Timing['F_ACTUAL']) / scan,
|
||||
(v_eff * freq_act) / scan,
|
||||
'Hz',
|
||||
{'p':3, 'output':'split', 'include':['>=b']},
|
||||
);
|
||||
|
||||
Detailed_Results['h_per'] = SI(
|
||||
scan / (v_eff * Timing['F_ACTUAL']),
|
||||
scan / (v_eff * freq_act),
|
||||
's',
|
||||
{'p':3, 'output':'split', 'include':['<=b']},
|
||||
);
|
||||
}
|
||||
|
||||
//DEBUG('Results:', SI(results['bits_per_sec_eff'], 'bit/s', 2), results);
|
||||
updateDisplay();
|
||||
@ -661,6 +740,9 @@ function getTiming(timing_standard) {
|
||||
'V_BL': '',
|
||||
'H_BL': '',
|
||||
|
||||
'V_EFF': '',
|
||||
'H_EFF': '',
|
||||
|
||||
'F_ACTUAL': Global_InputVars['FREQ'],
|
||||
};
|
||||
}
|
||||
@ -669,16 +751,26 @@ function getTiming(timing_standard) {
|
||||
if (timing_standard != 'Custom') {
|
||||
if (timing_standard == 'CVT-R2') {
|
||||
DEBUG('Fetching CVT-R2 Timing...')
|
||||
if (Global_InputVars['FREQ'] >= (1 / 0.00046)) {
|
||||
$('#TIMING_FORMAT_NAME').html('≥ 2173.9 Hz not allowed');
|
||||
return false;
|
||||
}
|
||||
Timing = CVT_R(2);
|
||||
if (!Timing) {
|
||||
DEBUG ('CVT-R2 calculation error.');
|
||||
clearTiming();
|
||||
return false; }
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$('#TIMING_FORMAT_NAME').html('<b>VESA Name:</b> ' + (Global_InputVars['HRES'] * Global_InputVars['VRES'] / 1000000).toFixed(2) + 'M' + Timing['VESA_AR'] + '-R');
|
||||
}
|
||||
}
|
||||
else if (timing_standard == 'CVT-RB') {
|
||||
DEBUG('Fetching CVT-R2 Timing...')
|
||||
if (Global_InputVars['FREQ'] >= (1 / 0.00046)) {
|
||||
$('#TIMING_FORMAT_NAME').html('≥ 2173.9 Hz not allowed');
|
||||
return false;
|
||||
}
|
||||
Timing = CVT_R(1);
|
||||
if (!Timing) {
|
||||
DEBUG ('CVT-RB calculation error.');
|
||||
@ -690,6 +782,10 @@ function getTiming(timing_standard) {
|
||||
}
|
||||
}
|
||||
else if (timing_standard == 'CVT') {
|
||||
if (Global_InputVars['FREQ'] >= (1 / 0.00055)) {
|
||||
$('#TIMING_FORMAT_NAME').html('≥ 1818.<span style="text-decoration: overline">18</span> Hz not allowed');
|
||||
return false;
|
||||
}
|
||||
Timing = CVT();
|
||||
if (!Timing) {
|
||||
DEBUG ('CVT calculation error.');
|
||||
@ -701,6 +797,10 @@ function getTiming(timing_standard) {
|
||||
}
|
||||
}
|
||||
else if (timing_standard == 'GTF') {
|
||||
if (Global_InputVars['FREQ'] >= (1 / 0.00055)) {
|
||||
$('#TIMING_FORMAT_NAME').html('≥ 1818.<span style="text-decoration: overline">18</span> Hz not allowed');
|
||||
return false;
|
||||
}
|
||||
Timing = GTF();
|
||||
$('#TIMING_FORMAT_NAME').html('');
|
||||
if (!Timing) {
|
||||
@ -747,7 +847,7 @@ function getTiming(timing_standard) {
|
||||
'V_BL': 0,
|
||||
'H_BL': 0,
|
||||
|
||||
'V_EFF': Global_InputVars['VRES'],
|
||||
'V_EFF': Global_InputVars['VRES'] / Global_InputVars['SCAN'],
|
||||
'H_EFF': Global_InputVars['HRES'],
|
||||
|
||||
'F_ACTUAL': Global_InputVars['FREQ'],
|
||||
@ -776,9 +876,9 @@ function getTiming(timing_standard) {
|
||||
submitVar('H_FP', $('#H_FP').val());
|
||||
submitVar('H_BP', $('#H_BP').val());
|
||||
submitVar('H_SW', $('#H_SW').val());
|
||||
submitVar('V_FP_INT', Global_InputVars['V_FP'] + 0.5);
|
||||
submitVar('V_SW_INT', Global_InputVars['V_SW']);
|
||||
submitVar('V_BP_INT', Global_InputVars['V_BP'] + 0.5);
|
||||
if (isNum(Global_InputVars['V_FP'])) { submitVar('V_FP_INT', Global_InputVars['V_FP'] + 0.5); }
|
||||
if (isNum(Global_InputVars['V_SW'])) { submitVar('V_SW_INT', Global_InputVars['V_SW']); }
|
||||
if (isNum(Global_InputVars['V_BP'])) { submitVar('V_BP_INT', Global_InputVars['V_BP'] + 0.5); }
|
||||
|
||||
Timing = {
|
||||
'V_FP': Global_InputVars['V_FP'],
|
||||
@ -1341,80 +1441,71 @@ function DMT() {
|
||||
}
|
||||
|
||||
|
||||
function updateDisplay() {
|
||||
function updateDisplay(mode) {
|
||||
var clear = 'clear'
|
||||
var cells;
|
||||
var id;
|
||||
|
||||
id_list = ['data_rate', '8b10b', '16b18b', 'pixel_rate', 'pixel_rate_active'];
|
||||
id_list = [
|
||||
'data_rate', '8b10b', '16b18b', 'pixel_rate', 'pixel_rate_active',
|
||||
'bpc', 'bpp', 'palette',
|
||||
|
||||
'v_freq', 'v_freq_actual', 'v_freq_dev', 'v_freq_dev_perc',
|
||||
'v_per', 'v_per_actual', 'v_per_dev', 'v_per_dev_perc',
|
||||
|
||||
'h_freq', 'h_per',
|
||||
|
||||
'v_field', 'v_field_actual', 'v_field_dev', 'v_field_dev_perc',
|
||||
'v_field_per', 'v_field_per_actual', 'v_field_per_dev', 'v_field_per_dev_perc',
|
||||
'v_frame', 'v_frame_actual', 'v_frame_dev', 'v_frame_dev_perc',
|
||||
'v_frame_per', 'v_frame_per_actual', 'v_frame_per_dev', 'v_frame_per_dev_perc',
|
||||
];
|
||||
for (var x = 0; x < id_list.length; x++) {
|
||||
id = id_list[x];
|
||||
cells = $('#results_' + id).children();
|
||||
if (mode != clear) {
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['val'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['unit'];
|
||||
} else {
|
||||
cells[1].innerHTML = '';
|
||||
cells[2].innerHTML = '';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
id_list = ['active_px', 'blank_px', 'total_px'];
|
||||
id_list = ['active_px', 'blank_px', 'total_px', 'overhead_px'];
|
||||
for (var x = 0; x < id_list.length; x++) {
|
||||
id = id_list[x];
|
||||
cells = $('#results_' + id).children();
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['h'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['v'];
|
||||
cells[3].innerHTML = Detailed_Results[id]['t']['val'];
|
||||
cells[4].innerHTML = Detailed_Results[id]['t']['unit'];
|
||||
}
|
||||
id = 'overhead_px';
|
||||
cells = $('#results_' + id).children();
|
||||
if (mode != clear) {
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['h']['val'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['v']['val'];
|
||||
cells[3].innerHTML = Detailed_Results[id]['t']['val'];
|
||||
cells[4].innerHTML = Detailed_Results[id]['t']['unit'];
|
||||
} else {
|
||||
cells[1].innerHTML = '';
|
||||
cells[2].innerHTML = '';
|
||||
cells[3].innerHTML = '';
|
||||
cells[4].innerHTML = '';
|
||||
}
|
||||
|
||||
id_list = ['bpc', 'bpp', 'palette'];
|
||||
}
|
||||
|
||||
id_list = ['px_format', 'scan'];
|
||||
for (var x = 0; x < id_list.length; x++) {
|
||||
id = id_list[x];
|
||||
cells = $('#results_' + id).children();
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['val'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['unit'];
|
||||
}
|
||||
|
||||
id = 'px_format';
|
||||
cells = $('#results_' + id).children();
|
||||
if (mode != clear) {
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]
|
||||
|
||||
id = 'scan';
|
||||
cells = $('#results_' + id).children();
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]
|
||||
|
||||
id_list = ['v_freq', 'v_freq_actual', 'v_freq_dev', 'v_freq_dev_perc', 'v_per', 'v_per_actual', 'v_per_dev', 'v_per_dev_perc'];
|
||||
for (var x = 0; x < id_list.length; x++) {
|
||||
id = id_list[x];
|
||||
cells = $('#results_' + id).children();
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['val'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['unit'];
|
||||
} else {
|
||||
cells[1].innerHTML = '';
|
||||
}
|
||||
|
||||
id_list = ['h_freq', 'h_per'];
|
||||
for (var x = 0; x < id_list.length; x++) {
|
||||
id = id_list[x];
|
||||
cells = $('#results_' + id).children();
|
||||
DEBUG('Detailed Results:', Detailed_Results[id]);
|
||||
DEBUG('Cells:', cells)
|
||||
cells[1].innerHTML = Detailed_Results[id]['val'];
|
||||
cells[2].innerHTML = Detailed_Results[id]['unit'];
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1422,9 +1513,14 @@ function updateDisplay() {
|
||||
|
||||
|
||||
function clearResults() {
|
||||
updateDisplay('clear');
|
||||
if ($('#TIMING_DROP').val() != 'Custom') {
|
||||
clearTiming();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function timingUIChange() {
|
||||
// Controls the enabled/disabled state of the custom timing format input fields
|
||||
var timing_params = [
|
||||
@ -1465,6 +1561,8 @@ function timingUIChange() {
|
||||
$('#V_SW_INT_CONTAINER').css('display', 'table-cell');
|
||||
$('#V_BLANK_INT_CONTAINER').css('display', 'table-cell');
|
||||
$('#V_BLANK_EVEN_LABEL').html('(Even) V<sub>blank</sub>');
|
||||
$('#results_v_progressive').css('display', 'none');
|
||||
$('#results_v_interlaced').css('display', 'table');
|
||||
}
|
||||
else if (value == 'p') {
|
||||
$('#V_BLANK_INT_LABEL').css('display', 'none');
|
||||
@ -1473,6 +1571,8 @@ function timingUIChange() {
|
||||
$('#V_SW_INT_CONTAINER').css('display', 'none');
|
||||
$('#V_BLANK_INT_CONTAINER').css('display', 'none');
|
||||
$('#V_BLANK_EVEN_LABEL').html('V<sub>blank</sub>');
|
||||
$('#results_v_progressive').css('display', 'table');
|
||||
$('#results_v_interlaced').css('display', 'none');
|
||||
}
|
||||
else {
|
||||
DEBUG('Something somewhere has gone terribly wrong. Attemped to grab SCAN_SLCT value, and it was neither "p" nor "i"!');
|
||||
|
@ -108,8 +108,8 @@
|
||||
</div>
|
||||
<div class="tcell" style="padding-left:4px; vertical-align:middle; line-height:125%; width:100%;">
|
||||
<form id="CD_UNIT_FORM" style="line-height:100%;" onchange="document.getElementById('CUSTOM_COLOR_DEPTH').focus(); submitVar('COLOR_DEPTH_FORM', $('input[name=COLOR_DEPTH_SLCT]:checked').val()); calcMain();" disabled>
|
||||
<label><input type="radio" name="CD_UNIT_SLCT" value="bpc" checked /> bpc</label><br />
|
||||
<label><input type="radio" name="CD_UNIT_SLCT" value="bpp" /> bit/px</label>
|
||||
<label><input type="radio" name="CD_UNIT_SLCT" value="bpc" checked disabled /> bpc</label><br />
|
||||
<label><input type="radio" name="CD_UNIT_SLCT" value="bpp" disabled /> bit/px</label>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -274,101 +274,109 @@
|
||||
<tr id='results_data_transmission'>
|
||||
<th class="label">Data Transmission</th><th class="val">Value</th><th class="unit">Unit</th></tr>
|
||||
<tr id='results_data_rate'>
|
||||
<td class="label">Data Rate</td><td class="val">8.00</td><td class="unit">Gbit/s</td></tr>
|
||||
<td class="label">Data Rate</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_bit_rate'>
|
||||
<td class="label">Bandwidth:</td><td></td><td></td></tr>
|
||||
<tr id='results_8b10b'>
|
||||
<td class="label depth2">8b/10b Encoding</td><td class="val">10.00</td><td class="unit">Gbit/s</td></tr>
|
||||
<td class="label depth2">8b/10b Encoding</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_16b18b'>
|
||||
<td class="label depth2">16b/18b Encoding</td><td class="val">9.00</td><td class="unit">Gbit/s</td></tr>
|
||||
<td class="label depth2">16b/18b Encoding</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<!----<tr id='results_char_rate'>
|
||||
<td class="label">TMDS Character Rate ("Pixel Clock")</td><td class="val">346</td><td class="unit">MHz</td></tr>-->
|
||||
<tr id='results_pixel_rate'>
|
||||
<td class="label">Pixel Rate (Effective)</td><td class="val">346</td><td class="unit">Mpx/s</td></tr>
|
||||
<td class="label">Pixel Rate (Effective)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_pixel_rate_active'>
|
||||
<td class="label">Pixel Rate (Active Pixels Only)</td><td class="val">346</td><td class="unit">Mpx/s</td></tr>
|
||||
<td class="label">Pixel Rate (Active Pixels Only)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<table class="results">
|
||||
<tr class="triple" id='results_resolution'>
|
||||
<th class="label">Resolution</th><th class="val">Hor.</th><th class="val">Ver.</th><th class="val">Total</th><th class="unit">Unit</th></tr>
|
||||
<tr class="triple" id='results_active_px'>
|
||||
<td class="label">Active</td><td class="val half">1920</td><td class="val half">1080</td><td class="val">2,073,600</td><td class="unit">px</td></tr>
|
||||
<td class="label">Active</td><td class="val half"></td><td class="val half"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr class="triple" id='results_blank_px'>
|
||||
<td class="label">Blank</td><td class="val half">80</td><td class="val half">77</td><td class="val">240,400</td><td class="unit">px</td></tr>
|
||||
<td class="label">Blank</td><td class="val half"></td><td class="val half"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr class="triple" id='results_total_px'>
|
||||
<td class="label">Effective Total</td><td class="val half">2000</td><td class="val half">1157</td><td class="val">2,314,000</td><td class="unit">px</td></tr>
|
||||
<td class="label">Effective Total</td><td class="val half"></td><td class="val half"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr class="triple" id='results_overhead_px'>
|
||||
<td class="label">Overhead</td><td class="val half">4.17</td><td class="val half">7.13</td><td class="val">11.59</td><td class="unit">%</td></tr>
|
||||
<td class="label">Overhead</td><td class="val half"></td><td class="val half"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<table class="results">
|
||||
<tr id='results_format'>
|
||||
<th class="label">Format</th><th class="val">Value</th><th class="unit">Unit</th></tr>
|
||||
<tr id='results_bpc'>
|
||||
<td class="label">Color Depth (Per Channel)</td><td class="val">8</td><td class="unit">bpc</td></tr>
|
||||
<td class="label">Color Depth (Per Channel)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_bpp'>
|
||||
<td class="label">Color Depth (Per Pixel)</td><td class="val">24</td><td class="unit">bit/px</td></tr>
|
||||
<td class="label">Color Depth (Per Pixel)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_palette'>
|
||||
<td class="label">Palette Size</td><td class="val">16,777,216</td><td class="unit">colors</td></tr>
|
||||
<td class="label">Palette Size</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_px_format'>
|
||||
<td class="label">Pixel Format</td><td class="val">RGB</td><td class="unit"></td></tr>
|
||||
<td class="label">Pixel Format</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_scan'>
|
||||
<td class="label">Scan Type</td><td class="val">Progressive</td><td class="unit"></td></tr>
|
||||
<td class="label">Scan Type</td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<table class="results">
|
||||
<table class="results" id='results_v_progressive'>
|
||||
<tr id='results_v_refresh'>
|
||||
<th class="label">Vertical Refresh</th><th class="val">Value</th><th class="unit">Unit</th></tr>
|
||||
<tr id='results_v_freq'>
|
||||
<td class="label">Frequency (Target)</td><td class="val">144.000</td><td class="unit">Hz</td></tr>
|
||||
<td class="label">Frequency (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_freq_actual'>
|
||||
<td class="label">Frequency (Actual)</td><td class="val">143.993</td><td class="unit">Hz</td></tr>
|
||||
<td class="label">Frequency (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_freq_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val">0.007</td><td class="unit">Hz</td></tr>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_freq_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val">0.00486</td><td class="unit">%</td></tr>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_per'>
|
||||
<td class="label">Period (Target)</td><td class="val">6.944</td><td class="unit">ms</td></tr>
|
||||
<td class="label">Period (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_per_actual'>
|
||||
<td class="label">Period (Actual)</td><td class="val">6.945</td><td class="unit">ms</td></tr>
|
||||
<td class="label">Period (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_per_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val">0.338</td><td class="unit">µs</td></tr>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_per_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val">0.00486</td><td class="unit">%</td></tr>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<table class="results" hidden>
|
||||
<table class="results" id='results_v_interlaced' style='display:none;'>
|
||||
<tr id='results_v_refresh_int'>
|
||||
<th class="label">Vertical Refresh</th><th class="val">Value</th><th class="unit">Unit</th></tr>
|
||||
<tr id='results_v_field'>
|
||||
<td class="label">Frequency / Field Rate (Target)</td><td class="val">144.000</td><td class="unit">Hz</td></tr>
|
||||
<td class="label">Field Rate (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_actual'>
|
||||
<td class="label">Frequency / Field Rate (Actual)</td><td class="val">143.993</td><td class="unit">Hz</td></tr>
|
||||
<td class="label">Field Rate (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val">0.007</td><td class="unit">Hz</td></tr>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val">0.00486</td><td class="unit">%</td></tr>
|
||||
<tr id='results_v_framerate'>
|
||||
<td class="label">Frame Rate (Target)</td><td class="val">72.000</td><td class="unit">Hz</td></tr>
|
||||
<tr id='results_v_framerate_actual'>
|
||||
<td class="label">Frame Rate (Actual)</td><td class="val">71.997</td><td class="unit">Hz</td></tr>
|
||||
<tr id='results_v_framerate_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val">0.003</td><td class="unit">Hz</td></tr>
|
||||
<tr id='results_v_framerate_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val">0.00486</td><td class="unit">%</td></tr>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_per'>
|
||||
<td class="label">Field Period (Target)</td><td class="val">6.944</td><td class="unit">ms</td></tr>
|
||||
<td class="label">Field Period (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_per_actual'>
|
||||
<td class="label">Field Period (Actual)</td><td class="val">6.945</td><td class="unit">ms</td></tr>
|
||||
<td class="label">Field Period (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_per_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val">0.338</td><td class="unit">µs</td></tr>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_field_per_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val">0.00486</td><td class="unit">%</td></tr>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame'>
|
||||
<td class="label">Frame Rate (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_actual'>
|
||||
<td class="label">Frame Rate (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_per'>
|
||||
<td class="label">Frame Period (Target)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_per_actual'>
|
||||
<td class="label">Frame Period (Actual)</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_per_dev'>
|
||||
<td class="label depth2">Deviation</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_v_frame_per_dev_perc'>
|
||||
<td class="label depth2"></td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<table class="results">
|
||||
<tr id='results_h_refresh'>
|
||||
<th class="label">Horizontal Refresh</th><th class="val">Value</th><th class="unit">Unit</th></tr>
|
||||
<tr id='results_h_freq'>
|
||||
<td class="label">Frequency</td><td class="val">167.757</td><td class="unit">kHz</td></tr>
|
||||
<td class="label">Frequency</td><td class="val"></td><td class="unit"></td></tr>
|
||||
<tr id='results_h_per'>
|
||||
<td class="label">Period</td><td class="val">5.961</td><td class="unit">µs</td></tr>
|
||||
<td class="label">Period</td><td class="val"></td><td class="unit"></td></tr>
|
||||
</table>
|
||||
<script>
|
||||
var tables = document.getElementById('results_container').children;
|
||||
|
@ -328,8 +328,6 @@ table.results td.unit {
|
||||
}
|
||||
table.results td.depth2 {
|
||||
padding-left: 50px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
table.results tr.double td.val {
|
||||
|
Loading…
x
Reference in New Issue
Block a user