mirror of
https://github.com/marqs85/ossc
synced 2025-04-09 22:56:34 +03:00
tvp7002: optimize CP current adjustment
Adjust charge pump current based on the number of pixels ultimately extracted from a line which can be less than sample rate. This seems to result in reduced jitter on optimized modes.
This commit is contained in:
parent
1ba1779632
commit
b45e0fb517
@ -268,7 +268,7 @@ void tvp_set_gain_offset(color_setup_t *col) {
|
||||
}
|
||||
|
||||
// Configure H-PLL (sampling rate, VCO gain and charge pump current)
|
||||
void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 refclks_per_line, alt_u8 plldivby2)
|
||||
void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 pixs_per_line, alt_u16 refclks_per_line, alt_u8 plldivby2)
|
||||
{
|
||||
alt_u32 pclk_est;
|
||||
alt_u8 vco_range;
|
||||
@ -303,7 +303,7 @@ void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 refclks_per_line, alt_u8 plldi
|
||||
vco_range = 3;
|
||||
}
|
||||
|
||||
cp_current = (40*Kvco[vco_range]+h_samplerate/2) / h_samplerate; //"+h_samplerate/2" for fast rounding
|
||||
cp_current = (40*Kvco[vco_range]+pixs_per_line/2) / pixs_per_line; //"+pixs_per_line/2" for fast rounding
|
||||
if (cp_current > 7)
|
||||
cp_current = 7;
|
||||
|
||||
@ -375,7 +375,7 @@ void tvp_set_alcfilt(alt_u8 nsv, alt_u8 nsh) {
|
||||
tvp_writereg(TVP_ALCFILT, (nsv<<3)|nsh);
|
||||
}
|
||||
|
||||
void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 refclks_per_line, alt_u8 plldivby2, alt_u8 h_synclen_px, alt_8 clamp_user_offset)
|
||||
void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 pixs_per_line, alt_u16 refclks_per_line, alt_u8 plldivby2, alt_u8 h_synclen_px, alt_8 clamp_user_offset)
|
||||
{
|
||||
// Due to short MVS width, clamp reference starts prematurely (at the end of MVS window). Adjust offset so that reference moves back to hsync trailing edge.
|
||||
alt_u8 clamp_ref_offset = h_synclen_px - (((30*h_samplerate)/refclks_per_line)+5)/10;
|
||||
@ -399,7 +399,7 @@ void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 refclks_per
|
||||
break;
|
||||
}
|
||||
|
||||
tvp_setup_hpll(h_samplerate, refclks_per_line, plldivby2);
|
||||
tvp_setup_hpll(h_samplerate, pixs_per_line, refclks_per_line, plldivby2);
|
||||
}
|
||||
|
||||
void tvp_source_sel(tvp_input_t input, tvp_sync_input_t syncinput, video_format fmt)
|
||||
|
@ -98,7 +98,7 @@ void tvp_init();
|
||||
|
||||
void tvp_set_gain_offset(color_setup_t *col);
|
||||
|
||||
void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 refclks_per_line, alt_u8 plldivby2);
|
||||
void tvp_setup_hpll(alt_u16 h_samplerate, alt_u16 pixs_per_line, alt_u16 refclks_per_line, alt_u8 plldivby2);
|
||||
|
||||
void tvp_sel_csc(const ypbpr_to_rgb_csc_t *csc);
|
||||
|
||||
@ -114,7 +114,7 @@ void tvp_set_sog_thold(alt_u8 val);
|
||||
|
||||
void tvp_set_alcfilt(alt_u8 nsv, alt_u8 nsh);
|
||||
|
||||
void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 refclks_per_line, alt_u8 plldivby2, alt_u8 h_synclen_px, alt_8 clamp_user_offset);
|
||||
void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 pixs_per_line, alt_u16 refclks_per_line, alt_u8 plldivby2, alt_u8 h_synclen_px, alt_8 clamp_user_offset);
|
||||
|
||||
void tvp_source_sel(tvp_input_t input, tvp_sync_input_t syncinput, video_format fmt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user