⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 panoramix.c

📁 VLC Player Source Code
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifndef GAMMA                                p_dst[i_index * i_out_pitch + i_index2] = (p_vout->p_sys->lambda2[0][i_plane][i_index] *                                             p_dst[i_index * i_out_pitch + i_index2]) / ACCURACY +                                             p_vout->p_sys->cstYUV2[0][i_plane][i_index];#else                                p_dst[i_index * i_out_pitch + i_index2] = p_vout->p_sys->LUT[i_plane][p_vout->p_sys->lambda2[0][i_plane][i_index]][p_dst[i_index * i_out_pitch + i_index2]];#endif                            }                        }                    }                    // end blended zone                }#endif                // bug for wall filter : fix by CC                //            pi_left_skip[i_plane] += i_out_pitch;                pi_left_skip[i_plane] += i_copy_pitch;            }            vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,                                p_outpic );            vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,                                 p_outpic );        }        for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )        {            pi_top_skip[i_plane] += p_vout->p_sys->pp_vout[ i_vout-1 ].i_height                                             * p_pic->p[i_plane].i_lines                                             / p_vout->output.i_height                                             * p_pic->p[i_plane].i_pitch;        }    }#ifdef OVERLAP    if (p_vout->p_sys->b_has_changed)        p_vout->p_sys->b_has_changed = false;#endif}/***************************************************************************** * RenderPackedRGB: displays previously rendered output ***************************************************************************** * This function send the currently rendered image to Wall image, waits * until it is displayed and switch the two rendering buffers, preparing next * frame. *****************************************************************************/static void RenderPackedRGB( vout_thread_t *p_vout, picture_t *p_pic ){    picture_t *p_outpic = NULL;    int i_col, i_row, i_vout, i_plane;    int pi_left_skip[VOUT_MAX_PLANES], pi_top_skip[VOUT_MAX_PLANES];#ifdef OVERLAP    int LeftOffset, TopOffset;    int Denom;    int a_2;    int a_1;    int a_0;    int i_index, i_index2;#endif    for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )        pi_top_skip[i_plane] = 0;    for( i_vout = 0, i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )    {        for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )            pi_left_skip[i_plane] = 0;        for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++, i_vout++ )        {            if( !p_vout->p_sys->pp_vout[ i_vout ].b_active )            {                for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )                {                    pi_left_skip[i_plane] +=                        p_vout->p_sys->pp_vout[ i_vout ].i_width * p_pic->p->i_pixel_pitch;                }                continue;            }            while( ( p_outpic =                vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,                                    0, 0, 0 )                   ) == NULL )            {                if( !vlc_object_alive (p_vout) || p_vout->b_error )                {                    vout_DestroyPicture(                        p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );                    return;                }                msleep( VOUT_OUTMEM_SLEEP );            }            vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,                              p_outpic, p_pic->date );            vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,                              p_outpic );            for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )            {                uint8_t *p_in, *p_in_end, *p_out;                int i_in_pitch = p_pic->p[i_plane].i_pitch;                int i_out_pitch = p_outpic->p[i_plane].i_pitch;                int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch;#ifdef OVERLAP                if (i_col)                    pi_left_skip[i_plane] -= (2 * p_vout->p_sys->i_halfLength) * p_pic->p->i_pixel_pitch;                if( p_vout->p_sys->i_row >= 2 )                {                    if( (i_row) && (!i_col))                        pi_top_skip[i_plane] -= (2 * p_vout->p_sys->i_halfHeight * p_pic->p[i_plane].i_pitch);                    if( (p_vout->p_sys->i_row > 2) && (i_row == 1) && (!i_col) )                        pi_top_skip[i_plane] -= (2 * p_vout->p_sys->i_halfHeight * p_pic->p[i_plane].i_pitch);                    if( !p_vout->p_sys->pp_vout[p_vout->p_sys->i_col-1].b_active )                        pi_top_skip[i_plane] -= (2 * p_vout->p_sys->i_halfHeight * i_row * p_pic->p[i_plane].i_pitch);                }// i_n : previous inactive pp_vout                int i_n=0;                while ((!p_vout->p_sys->pp_vout[i_row * p_vout->p_sys->i_col + i_col - 1 - i_n].b_active) && (i_col - i_n > 1)) i_n++;                if ((i_col > 1) && i_n)                    pi_left_skip[i_plane] -= i_n*(2 * p_vout->p_sys->i_halfLength ) * p_pic->p->i_pixel_pitch;                p_in = p_pic->p[i_plane].p_pixels                /* Wall proprities */                + pi_top_skip[i_plane] + pi_left_skip[i_plane];                int i_lines = p_outpic->p[i_plane].i_visible_lines;// 1088 lines bug in a mpeg2 stream of 1080 lines                if ((p_vout->p_sys->i_row - 1 == i_row) &&                    (p_pic->p[i_plane].i_lines == 1088))                        i_lines -= 8;                p_in_end = p_in + i_lines * p_pic->p[i_plane].i_pitch;#else                p_in = p_pic->p[i_plane].p_pixels                        + pi_top_skip[i_plane] + pi_left_skip[i_plane];                p_in_end = p_in + p_outpic->p[i_plane].i_visible_lines                                        * p_pic->p[i_plane].i_pitch;#endif //OVERLAP                p_out = p_outpic->p[i_plane].p_pixels;#ifdef OVERLAP        if ((p_vout->p_sys->i_row > 2) && (!i_row))            p_out += (p_outpic->p[i_plane].i_pitch * (2 * p_vout->p_sys->i_halfHeight) * p_pic->p->i_pixel_pitch);        int length;        length = 2 * p_vout->p_sys->i_halfLength * p_pic->p->i_pixel_pitch;        if (p_vout->p_sys->b_has_changed)        {            int i_plane_;            int i_col_mod;            Denom = F2(length / p_pic->p->i_pixel_pitch);            a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);            a_1 = p_vout->p_sys->a_1 * 2 * p_vout->p_sys->i_halfLength * (ACCURACY / 100);            a_0 = p_vout->p_sys->a_0 * Denom * (ACCURACY / 100);            for(i_col_mod = 0; i_col_mod < 2; i_col_mod++)                for (i_index = 0; i_index < length / p_pic->p->i_pixel_pitch; i_index++)                    for (i_plane_ =  0; i_plane_ < p_pic->p->i_pixel_pitch; i_plane_++)                        p_vout->p_sys->lambda[i_col_mod][i_plane_][i_index] = CLIP_0A(!i_col_mod ? ACCURACY - (F4(a_2, a_1, i_index) + a_0) / Denom : ACCURACY - (F4(a_2, a_1,(length / p_pic->p->i_pixel_pitch) - i_index) + a_0) / Denom);        }#endif            while( p_in < p_in_end )            {#ifndef OVERLAP                vlc_memcpy( p_out, p_in, i_copy_pitch );#else                if (p_vout->p_sys->i_col > 2)                {                    // vertical blend                    length /= 2;                    if (i_col == 0)                        vlc_memcpy( p_out + length, p_in, i_copy_pitch - length);                    else if (i_col + 1 == p_vout->p_sys->i_col)                        vlc_memcpy( p_out, p_in - length, i_copy_pitch - length);                    else                        vlc_memcpy( p_out, p_in - length, i_copy_pitch);                    if ((i_col == 0))                    // black bar                    {                        LeftOffset = 0;                        p_out += LeftOffset;                        p_in += LeftOffset;                        for (i_index = 0; i_index < length; i_index++)                                *(p_out + i_index) = 0;                        p_out -= LeftOffset;                        p_in -= LeftOffset;                    }                    else if ((i_col + 1 == p_vout->p_sys->i_col ))                    // black bar                        {                            LeftOffset = i_copy_pitch - length;                            p_out += LeftOffset;                            p_in += LeftOffset;                            for (i_index = 0; i_index < length; i_index++)                                    *(p_out + i_index) = 0;                            p_out -= LeftOffset;                            p_in -= LeftOffset;                        }                    length *= 2;                }                else                    vlc_memcpy( p_out, p_in, i_copy_pitch);// vertical blend// first blended zone            if (i_col)            {                LeftOffset = 0;                p_out += LeftOffset;                for (i_index = 0; i_index < length; i_index++)#ifndef GAMMA                    *(p_out + i_index) = (p_vout->p_sys->lambda[1][i_index % p_pic->p->i_pixel_pitch][i_index / p_pic->p->i_pixel_pitch] *                                 (*(p_out + i_index))) / ACCURACY;#else                    *(p_out + i_index) = p_vout->p_sys->LUT[i_index % p_pic->p->i_pixel_pitch][p_vout->p_sys->lambda[1][i_index % p_pic->p->i_pixel_pitch][i_index / p_pic->p->i_pixel_pitch]][*(p_out + i_index)];#endif                p_out -= LeftOffset;            }// second blended zone            if (i_col + 1 < p_vout->p_sys->i_col)            {                LeftOffset = i_copy_pitch - length;                p_out +=  LeftOffset;                for (i_index = 0; i_index < length; i_index++)#ifndef GAMMA                    *(p_out + i_index) = (p_vout->p_sys->lambda[0][i_index % p_pic->p->i_pixel_pitch][i_index / p_pic->p->i_pixel_pitch] *                                 (*(p_out + i_index))) / ACCURACY;#else                    *(p_out + i_index) = p_vout->p_sys->LUT[i_index % p_pic->p->i_pixel_pitch][p_vout->p_sys->lambda[0][i_index % p_pic->p->i_pixel_pitch][i_index / p_pic->p->i_pixel_pitch]][*(p_out + i_index)];#endif                p_out -= LeftOffset;            }// end blended zone#endif //OVERLAP                p_in += i_in_pitch;                p_out += i_out_pitch;            }#ifdef OVERLAP// horizontal blend        if (!p_vout->p_sys->b_attenuate)        {            if ((i_row == 0) && (p_vout->p_sys->i_row > 2))            // black bar            {                    TopOffset = i_lines + (2 * p_vout->p_sys->i_halfHeight);                    p_out -= TopOffset * p_outpic->p[i_plane].i_pitch;                    for (i_index = 0; i_index < length; i_index++)                        for (i_index2 = 0; i_index2 < i_copy_pitch; i_index2++)                            *(p_out + (i_index * p_outpic->p[i_plane].i_pitch) + i_index2) = 0;                    p_out += TopOffset * p_outpic->p[i_plane].i_pitch;            }            else if ((i_row + 1 == p_vout->p_sys->i_row) && (p_vout->p_sys->i_row > 2))            // black bar                {                    TopOffset = length - (2 * p_vout->p_sys->i_halfHeight);                    p_out -= TopOffset * p_outpic->p[i_plane].i_pitch;                    for (i_index = 0; i_index < length; i_index++)                        for (i_index2 = 0; i_index2 < i_copy_pitch; i_index2++)                            *(p_out + (i_index * p_outpic->p[i_plane].i_pitch) + i_index2) = 0;                    p_out += TopOffset * p_outpic->p[i_plane].i_pitch;                }        }        else        {            if (p_vout->p_sys->i_row >= 2)            {                length = 2 * p_vout->p_sys->i_halfHeight;                if (p_vout->p_sys->b_has_changed)                {                    int i_plane_;                    int i_row_mod;                    Denom = F2(length);                    a_2 = p_vout->p_sys->a_2 * (ACCURACY / 100);                    a_1 = p_vout->p_sys->a_1 * length * (ACCURACY / 100);                    a_0 = p_vout->p_sys->a_0 * Denom * (ACCURACY / 100);                    for(i_row_mod = 0; i_row_mod < 2; i_row_mod++)                      for (i_index = 0; i_index < length; i_index++)                        for (i_plane_ =  0; i_plane_ < p_pic->p->i_pixel_pitch; i_plane_++)                            p_vout->p_sys->lambda2[i_row_mod][i_plane_][i_index] = CLIP_0A(!i_row_mod ? ACCURACY - (F4(a_2, a_1, i_index) + a_0) / Denom : ACCURAC

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -