642 |
} |
} |
643 |
} |
} |
644 |
|
|
645 |
|
#define CALC_BI_STRIDE(width,bitcount) ((((width * bitcount) + 31) & ~31) >> 3) |
646 |
|
|
647 |
LRESULT compress(CODEC * codec, ICCOMPRESS * icc) |
LRESULT compress(CODEC * codec, ICCOMPRESS * icc) |
648 |
{ |
{ |
773 |
} |
} |
774 |
|
|
775 |
frame.input.plane[0] = icc->lpInput; |
frame.input.plane[0] = icc->lpInput; |
776 |
frame.input.stride[0] = (((icc->lpbiInput->biWidth * icc->lpbiInput->biBitCount) + 31) & ~31) >> 3; |
frame.input.stride[0] = CALC_BI_STRIDE(icc->lpbiInput->biWidth, icc->lpbiInput->biBitCount); |
777 |
|
|
778 |
if ((frame.input.csp = get_colorspace(inhdr)) == XVID_CSP_NULL) |
if ((frame.input.csp = get_colorspace(inhdr)) == XVID_CSP_NULL) |
779 |
return ICERR_BADFORMAT; |
return ICERR_BADFORMAT; |
926 |
outhdr->biPlanes = 1; |
outhdr->biPlanes = 1; |
927 |
outhdr->biBitCount = 24; |
outhdr->biBitCount = 24; |
928 |
outhdr->biCompression = BI_RGB; /* sonic foundry vegas video v3 only supports BI_RGB */ |
outhdr->biCompression = BI_RGB; /* sonic foundry vegas video v3 only supports BI_RGB */ |
929 |
outhdr->biSizeImage = outhdr->biWidth * outhdr->biHeight * outhdr->biBitCount / 8; |
outhdr->biSizeImage = outhdr->biWidth * CALC_BI_STRIDE(outhdr->biHeight, outhdr->biBitCount); |
930 |
outhdr->biXPelsPerMeter = 0; |
outhdr->biXPelsPerMeter = 0; |
931 |
outhdr->biYPelsPerMeter = 0; |
outhdr->biYPelsPerMeter = 0; |
932 |
outhdr->biClrUsed = 0; |
outhdr->biClrUsed = 0; |
1030 |
|
|
1031 |
convert.input.csp = get_colorspace(icd->lpbiInput); |
convert.input.csp = get_colorspace(icd->lpbiInput); |
1032 |
convert.input.plane[0] = icd->lpInput; |
convert.input.plane[0] = icd->lpInput; |
1033 |
convert.input.stride[0] = (((icd->lpbiInput->biWidth *icd->lpbiInput->biBitCount) + 31) & ~31) >> 3; |
convert.input.stride[0] = CALC_BI_STRIDE(icd->lpbiInput->biWidth, icd->lpbiInput->biBitCount); |
1034 |
if (convert.input.csp == XVID_CSP_I420 || convert.input.csp == XVID_CSP_YV12) |
if (convert.input.csp == XVID_CSP_I420 || convert.input.csp == XVID_CSP_YV12) |
1035 |
convert.input.stride[0] = (convert.input.stride[0]*2)/3; |
convert.input.stride[0] = (convert.input.stride[0]*2)/3; |
1036 |
|
|
1037 |
convert.output.csp = get_colorspace(icd->lpbiOutput); |
convert.output.csp = get_colorspace(icd->lpbiOutput); |
1038 |
convert.output.plane[0] = icd->lpOutput; |
convert.output.plane[0] = icd->lpOutput; |
1039 |
convert.output.stride[0] = (((icd->lpbiOutput->biWidth *icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; |
convert.output.stride[0] = CALC_BI_STRIDE(icd->lpbiOutput->biWidth, icd->lpbiOutput->biBitCount); |
1040 |
if (convert.output.csp == XVID_CSP_I420 || convert.output.csp == XVID_CSP_YV12) |
if (convert.output.csp == XVID_CSP_I420 || convert.output.csp == XVID_CSP_YV12) |
1041 |
convert.output.stride[0] = (convert.output.stride[0]*2)/3; |
convert.output.stride[0] = (convert.output.stride[0]*2)/3; |
1042 |
|
|
1066 |
return ICERR_BADFORMAT; |
return ICERR_BADFORMAT; |
1067 |
} |
} |
1068 |
frame.output.plane[0] = icd->lpOutput; |
frame.output.plane[0] = icd->lpOutput; |
1069 |
frame.output.stride[0] = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3; |
frame.output.stride[0] = CALC_BI_STRIDE(icd->lpbiOutput->biWidth, icd->lpbiOutput->biBitCount); |
1070 |
if (frame.output.csp == XVID_CSP_I420 || frame.output.csp == XVID_CSP_YV12) |
if (frame.output.csp == XVID_CSP_I420 || frame.output.csp == XVID_CSP_YV12) |
1071 |
frame.output.stride[0] = (frame.output.stride[0]*2)/3; |
frame.output.stride[0] = CALC_BI_STRIDE(icd->lpbiOutput->biWidth, 8); |
1072 |
} |
} |
1073 |
else |
else |
1074 |
{ |
{ |