172 |
} |
} |
173 |
|
|
174 |
if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight || |
if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight || |
175 |
(outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX)) |
(outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX && outhdr->biCompression != FOURCC_DX50)) |
176 |
{ |
{ |
177 |
return ICERR_BADFORMAT; |
return ICERR_BADFORMAT; |
178 |
} |
} |
451 |
frame.motion = pmvfast_presets[codec->config.motion_search]; |
frame.motion = pmvfast_presets[codec->config.motion_search]; |
452 |
|
|
453 |
frame.image = icc->lpInput; |
frame.image = icc->lpInput; |
454 |
|
// dev-api-3 |
455 |
|
frame.stride = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3; |
456 |
|
|
457 |
if ((frame.colorspace = get_colorspace(inhdr)) == XVID_CSP_NULL) |
if ((frame.colorspace = get_colorspace(inhdr)) == XVID_CSP_NULL) |
458 |
return ICERR_BADFORMAT; |
return ICERR_BADFORMAT; |
611 |
return ICERR_ERROR; |
return ICERR_ERROR; |
612 |
} |
} |
613 |
|
|
614 |
if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX) |
if (inhdr->biCompression != FOURCC_XVID && |
615 |
|
inhdr->biCompression != FOURCC_DIVX && |
616 |
|
inhdr->biCompression != FOURCC_DX50 && |
617 |
|
get_colorspace(inhdr) == XVID_CSP_NULL) |
618 |
{ |
{ |
619 |
return ICERR_BADFORMAT; |
return ICERR_BADFORMAT; |
620 |
} |
} |
646 |
return sizeof(BITMAPINFOHEADER); |
return sizeof(BITMAPINFOHEADER); |
647 |
} |
} |
648 |
|
|
649 |
|
/* --- yv12 --- */ |
650 |
|
if (get_colorspace(inhdr) != XVID_CSP_NULL) { |
651 |
|
memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER)); |
652 |
|
// XXX: should we set outhdr->biSize ?? |
653 |
|
return ICERR_OK; |
654 |
|
} |
655 |
|
/* --- yv12 --- */ |
656 |
|
|
657 |
result = decompress_query(codec, lpbiInput, lpbiOutput); |
result = decompress_query(codec, lpbiInput, lpbiOutput); |
658 |
if (result != ICERR_OK) |
if (result != ICERR_OK) |
659 |
{ |
{ |
725 |
frame.length = icd->lpbiInput->biSizeImage; |
frame.length = icd->lpbiInput->biSizeImage; |
726 |
|
|
727 |
frame.image = icd->lpOutput; |
frame.image = icd->lpOutput; |
728 |
frame.stride = icd->lpbiOutput->biWidth; |
//frame.stride = icd->lpbiOutput->biWidth; |
729 |
|
// dev-api-3: |
730 |
|
frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; |
731 |
|
|
732 |
|
/* --- yv12 --- */ |
733 |
|
if (icd->lpbiInput->biCompression != FOURCC_XVID && |
734 |
|
icd->lpbiInput->biCompression != FOURCC_DIVX && |
735 |
|
icd->lpbiInput->biCompression != FOURCC_DX50) |
736 |
|
{ |
737 |
|
XVID_INIT_CONVERTINFO convert; |
738 |
|
|
739 |
|
DEBUGFOURCC("input", icd->lpbiInput->biCompression); |
740 |
|
DEBUGFOURCC("output", icd->lpbiOutput->biCompression); |
741 |
|
|
742 |
|
convert.input.colorspace = get_colorspace(icd->lpbiInput); |
743 |
|
convert.input.y = icd->lpInput; |
744 |
|
convert.input.y_stride = (((icd->lpbiInput->biWidth * icd->lpbiInput->biBitCount) + 31) & ~31) >> 3; |
745 |
|
|
746 |
|
convert.output.colorspace = get_colorspace(icd->lpbiOutput); |
747 |
|
convert.output.y = icd->lpOutput; |
748 |
|
convert.output.y_stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; |
749 |
|
|
750 |
|
convert.width = icd->lpbiInput->biWidth; |
751 |
|
convert.height = icd->lpbiInput->biHeight; |
752 |
|
convert.interlacing = 0; |
753 |
|
|
754 |
|
if (convert.input.colorspace == XVID_CSP_NULL || |
755 |
|
convert.output.colorspace == XVID_CSP_NULL || |
756 |
|
xvid_init(NULL, XVID_INIT_CONVERT, &convert, NULL) != XVID_ERR_OK) |
757 |
|
{ |
758 |
|
return ICERR_BADFORMAT; |
759 |
|
} |
760 |
|
|
761 |
|
return ICERR_OK; |
762 |
|
} |
763 |
|
/* --- yv12 --- */ |
764 |
|
|
765 |
|
|
766 |
if (~((icd->dwFlags & ICDECOMPRESS_HURRYUP) | (icd->dwFlags & ICDECOMPRESS_UPDATE) | (icd->dwFlags & ICDECOMPRESS_PREROLL))) |
if (~((icd->dwFlags & ICDECOMPRESS_HURRYUP) | (icd->dwFlags & ICDECOMPRESS_UPDATE) | (icd->dwFlags & ICDECOMPRESS_PREROLL))) |
767 |
{ |
{ |