123 |
if (create->width%2 || create->height%2) |
if (create->width%2 || create->height%2) |
124 |
return XVID_ERR_FAIL; |
return XVID_ERR_FAIL; |
125 |
|
|
126 |
|
if (create->width<=0 || create->height<=0) |
127 |
|
return XVID_ERR_FAIL; |
128 |
|
|
129 |
/* allocate encoder struct */ |
/* allocate encoder struct */ |
130 |
|
|
131 |
pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE); |
pEnc = (Encoder *) xvid_malloc(sizeof(Encoder), CACHE_LINE); |
655 |
data.max_quant[i] = pEnc->mbParam.max_quant[i]; |
data.max_quant[i] = pEnc->mbParam.max_quant[i]; |
656 |
} |
} |
657 |
|
|
658 |
data.reference.csp = XVID_CSP_USER; |
data.reference.csp = XVID_CSP_PLANAR; |
659 |
data.reference.plane[0] = pEnc->reference->image.y; |
data.reference.plane[0] = pEnc->reference->image.y; |
660 |
data.reference.plane[1] = pEnc->reference->image.u; |
data.reference.plane[1] = pEnc->reference->image.u; |
661 |
data.reference.plane[2] = pEnc->reference->image.v; |
data.reference.plane[2] = pEnc->reference->image.v; |
663 |
data.reference.stride[1] = pEnc->mbParam.edged_width/2; |
data.reference.stride[1] = pEnc->mbParam.edged_width/2; |
664 |
data.reference.stride[2] = pEnc->mbParam.edged_width/2; |
data.reference.stride[2] = pEnc->mbParam.edged_width/2; |
665 |
|
|
666 |
data.current.csp = XVID_CSP_USER; |
data.current.csp = XVID_CSP_PLANAR; |
667 |
data.current.plane[0] = frame->image.y; |
data.current.plane[0] = frame->image.y; |
668 |
data.current.plane[1] = frame->image.u; |
data.current.plane[1] = frame->image.u; |
669 |
data.current.plane[2] = frame->image.v; |
data.current.plane[2] = frame->image.v; |
693 |
|
|
694 |
} else { /* XVID_PLG_AFTER */ |
} else { /* XVID_PLG_AFTER */ |
695 |
if ((pEnc->mbParam.plugin_flags & XVID_REQORIGINAL)) { |
if ((pEnc->mbParam.plugin_flags & XVID_REQORIGINAL)) { |
696 |
data.original.csp = XVID_CSP_USER; |
data.original.csp = XVID_CSP_PLANAR; |
697 |
data.original.plane[0] = original->y; |
data.original.plane[0] = original->y; |
698 |
data.original.plane[1] = original->u; |
data.original.plane[1] = original->u; |
699 |
data.original.plane[2] = original->v; |
data.original.plane[2] = original->v; |
1443 |
start_timer(); |
start_timer(); |
1444 |
image_setedges(&pEnc->current->image, |
image_setedges(&pEnc->current->image, |
1445 |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
pEnc->mbParam.edged_width, pEnc->mbParam.edged_height, |
1446 |
pEnc->mbParam.width, pEnc->mbParam.height); |
pEnc->mbParam.width, pEnc->mbParam.height, 0); |
1447 |
stop_edges_timer(); |
stop_edges_timer(); |
1448 |
} |
} |
1449 |
|
|
1554 |
if (!reference->is_edged) { |
if (!reference->is_edged) { |
1555 |
start_timer(); |
start_timer(); |
1556 |
image_setedges(pRef, pParam->edged_width, pParam->edged_height, |
image_setedges(pRef, pParam->edged_width, pParam->edged_height, |
1557 |
pParam->width, pParam->height); |
pParam->width, pParam->height, 0); |
1558 |
stop_edges_timer(); |
stop_edges_timer(); |
1559 |
reference->is_edged = 1; |
reference->is_edged = 1; |
1560 |
} |
} |
1952 |
if (!pEnc->reference->is_edged) { |
if (!pEnc->reference->is_edged) { |
1953 |
image_setedges(f_ref, pEnc->mbParam.edged_width, |
image_setedges(f_ref, pEnc->mbParam.edged_width, |
1954 |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
1955 |
pEnc->mbParam.height); |
pEnc->mbParam.height, 0); |
1956 |
pEnc->current->is_edged = 1; |
pEnc->current->is_edged = 1; |
1957 |
} |
} |
1958 |
|
|
1969 |
if (!pEnc->current->is_edged) { |
if (!pEnc->current->is_edged) { |
1970 |
image_setedges(b_ref, pEnc->mbParam.edged_width, |
image_setedges(b_ref, pEnc->mbParam.edged_width, |
1971 |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
pEnc->mbParam.edged_height, pEnc->mbParam.width, |
1972 |
pEnc->mbParam.height); |
pEnc->mbParam.height, 0); |
1973 |
pEnc->current->is_edged = 1; |
pEnc->current->is_edged = 1; |
1974 |
} |
} |
1975 |
|
|