@xboot
大神,请问下,CVBS有些锯齿,有什么办法吗??
跪求了
锯齿问题,是CVBS奇偶场引起的,需要用De-Interlace处理。但是在C100上如何使用,这又是另一个难题了...
好像要用到DE模块...搞不懂
微凉VeiLiang 说:赞,显示效果上个月又调试了一下,发现有个寄存器需要调下,锯齿效果会好很多,晚点发出来
TVD_REG_BASE+0x001c 这个寄存器的bit0 要等于0.原来初始化写的0x0087002f改成0x0087002a 显示效果好很多
请问下大侠,这个寄存器是什么意思呢,我在全志的D1S上驱动CVBS也有锯齿这个问题,不知道能否改寄存器也能否优化。
]]>===============================================
object-fit:指定可替换元素的内容应该如何适应到其使用的高度和宽度确定的框。与我们熟悉的background-size属性有点相似。
contain被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比。 整个对象在填充盒子的同时保留其长宽比,因此如果宽高比与框的宽高比不匹配,该对象将被添加“黑边”。
cover被替换的内容在保持其宽高比的同时填充元素的整个内容框。如果对象的宽高比与内容框不相匹配,该对象将被剪裁以适应内容框。
fill被替换的内容正好填充元素的内容框。整个对象将完全填充此框。如果对象的宽高比与内容框不相匹配,那么该对象将被拉伸以适应内容框。
none被替换的内容将保持其原有的尺寸。
scale-down内容的尺寸与 none 或 contain 中的一个相同,取决于它们两个之间谁得到的对象尺寸会更小一些。
switch(opt & (0x3 << 12))
{
case XUI_IMAGE_NONE:
sx = 1.0;
sy = 1.0;
break;
case XUI_IMAGE_CONTAIN:
sx = (double)r->w / (double)surface_get_width(s);
sy = (double)r->h / (double)surface_get_height(s);
if(sx >= sy)
sx = sy;
else
sy = sx;
break;
case XUI_IMAGE_COVER:
sx = (double)r->w / (double)surface_get_width(s);
sy = (double)r->h / (double)surface_get_height(s);
if(sx <= sy)
sx = sy;
else
sy = sx;
break;
case XUI_IMAGE_FILL:
sx = (double)r->w / (double)surface_get_width(s);
sy = (double)r->h / (double)surface_get_height(s);
break;
default:
sx = 1.0;
sy = 1.0;
break;
}
matrix_init_translate(&m, r->x + r->w / 2, r->y + r->h / 2);
if(angle != 0.0)
matrix_rotate(&m, angle);
matrix_translate(&m, -surface_get_width(s) / 2 * sx, -surface_get_height(s) / 2 * sy);
matrix_scale(&m, sx, sy);
把初始化函数f1c100s_tvd_init中的width改成800,height改成600:
struct cam_f1c100s_tvd_pdata_t {
virtual_addr_t virt;
char * clk;
int irq;
int reset;
int channel;
//unsigned char yc[720 * 576 * 2];
unsigned char yc[800 * 600 * 2];
enum video_format_t fmt;
int width;
int height;
int buflen;
int ready;
};
......
s = f1c100s_tvd_get_source(pdat);
if(s == TVD_SOURCE_NTSC)
{
pdat->fmt = VIDEO_FORMAT_NV12;
pdat->width = 720;
pdat->height = 480;
pdat->buflen = pdat->width * pdat->height * 2;
pdat->ready = 0;
f1c100s_tvd_config(pdat, s, TVD_PL_YUV420);
f1c100s_tvd_set_fmt(pdat, TVD_PL_YUV420);
f1c100s_tvd_set_addr(pdat, &pdat->yc[0], &pdat->yc[pdat->width * pdat->height]);
}
else if(s == TVD_SOURCE_PAL)
{
pdat->fmt = VIDEO_FORMAT_NV12;
//pdat->width = 720;
//pdat->height = 576;
pdat->width = 800;
pdat->height = 600;
pdat->buflen = pdat->width * pdat->height * 2;
pdat->ready = 0;
f1c100s_tvd_config(pdat, s, TVD_PL_YUV420);
f1c100s_tvd_set_fmt(pdat, TVD_PL_YUV420);
f1c100s_tvd_set_addr(pdat, &pdat->yc[0], &pdat->yc[pdat->width * pdat->height]);
}
f1c100s_tvd_set_blue(pdat, 2);
f1c100s_tvd_capture_off(pdat);
f1c100s_tvd_irq_clear(pdat);
f1c100s_tvd_irq_disable(pdat);
显示就不正常了:
把draw_preview函数里面的width和height改成800和600:
pdat->s->width = 800;
pdat->s->height = 600;
matrix_init_translate(&m, (surface_get_width(s) - surface_get_width(pdat->s)) / 2, (surface_get_height(s) - surface_get_height(pdat->s)) / 2);
surface_blit(s, NULL, &m, pdat->s, RENDER_TYPE_GOOD);
显示效果只是移了一下位置