Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am currently doing video scaler project, in which I have to upscalce the PAL and NTSC videos to HDTV videos, I have chosen bicubic interpolation algorithm[^] for this. But I am finding difficulty in selecting the 16 neighbouring pixels for interpolation (especially the border cases). If anybody did some work on this...

Please give me reply. It would be helpful for me.....
Posted
Updated 2-Jun-10 2:24am
v2

1 solution

In my "Plain C Resampling DLL", following Libor Tinka's ("Image Resizing - outperform GDI+") approach, I discarded the out-of-border contributions in the weighted sum, i.e. something like:

C
for (j = left; j<= right; j++)
{
    if ( j < 0 || j >= iw) continue; /* HERE out-of border contributions are discarded */
    weight = (*pFnFilter)( (center - j) * FILTER_FACTOR);
    if (weight == 0.0) continue;
    n = h_count[i]; /* Since h_count[i] is our current index */
    p_pixel[n] = j;
    p_weight[n] = weight;
    h_wsum[i] += weight; /* the sum is weighted */
    h_count[i]++; /* Increment contribution count */
}/* j */


:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900