319 |
|
|
320 |
m_tray_icon = 0; |
m_tray_icon = 0; |
321 |
m_startClock = clock(); |
m_startClock = clock(); |
322 |
|
interlaced = 0; |
323 |
|
|
324 |
#if defined(XVID_USE_MFT) |
#if defined(XVID_USE_MFT) |
325 |
InitializeCriticalSection(&m_mft_lock); |
InitializeCriticalSection(&m_mft_lock); |
729 |
vih->dwPictAspectRatioY = abs(m_create.height); |
vih->dwPictAspectRatioY = abs(m_create.height); |
730 |
forced_ar = false; |
forced_ar = false; |
731 |
} |
} |
732 |
|
if (interlaced) { |
733 |
|
vih->dwInterlaceFlags = AMINTERLACE_IsInterlaced; |
734 |
|
if (interlaced > 1) { |
735 |
|
vih->dwInterlaceFlags |= AMINTERLACE_Field1First; |
736 |
|
} |
737 |
|
} |
738 |
|
else { |
739 |
|
vih->dwInterlaceFlags = 0; |
740 |
|
} |
741 |
} else { |
} else { |
742 |
|
|
743 |
VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER)); |
VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER)); |
1169 |
{ |
{ |
1170 |
vihOut2->dwPictAspectRatioX = ar_x; |
vihOut2->dwPictAspectRatioX = ar_x; |
1171 |
vihOut2->dwPictAspectRatioY = ar_y; |
vihOut2->dwPictAspectRatioY = ar_y; |
1172 |
|
if (interlaced) { |
1173 |
|
vihOut2->dwInterlaceFlags = AMINTERLACE_IsInterlaced; |
1174 |
|
if (interlaced > 2) { |
1175 |
|
vihOut2->dwInterlaceFlags |= AMINTERLACE_Field1First; |
1176 |
|
} |
1177 |
|
} |
1178 |
|
else { |
1179 |
|
vihOut2->dwInterlaceFlags = 0; |
1180 |
|
} |
1181 |
pOut2->SetMediaType(&mtOut2); |
pOut2->SetMediaType(&mtOut2); |
1182 |
m_pOutput->SetMediaType(&mtOut2); |
m_pOutput->SetMediaType(&mtOut2); |
1183 |
} |
} |
1602 |
} |
} |
1603 |
|
|
1604 |
if (SUCCEEDED(hr)) { |
if (SUCCEEDED(hr)) { |
1605 |
|
if (interlaced > 1) { |
1606 |
|
hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedUpperFirst); |
1607 |
|
} |
1608 |
|
else if (interlaced) { |
1609 |
|
hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_FieldInterleavedLowerFirst); |
1610 |
|
} |
1611 |
|
else { |
1612 |
hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); |
hr = pOutputType->SetUINT32(MF_MT_INTERLACE_MODE, MFVideoInterlace_Progressive); |
1613 |
} |
} |
1614 |
|
} |
1615 |
|
|
1616 |
if (SUCCEEDED(hr)) { |
if (SUCCEEDED(hr)) { |
1617 |
hr = MFSetAttributeRatio(pOutputType, MF_MT_PIXEL_ASPECT_RATIO, ar_x, ar_y); |
hr = MFSetAttributeRatio(pOutputType, MF_MT_PIXEL_ASPECT_RATIO, ar_x, ar_y); |
2076 |
or it'll have no effect at all... */ |
or it'll have no effect at all... */ |
2077 |
} |
} |
2078 |
|
|
2079 |
|
if (stats.data.vol.general & XVID_VOL_INTERLACING) { |
2080 |
|
interlaced = (stats.data.vop.general & XVID_VOP_TOPFIELDFIRST) ? 2 : 1; |
2081 |
|
} |
2082 |
|
else { |
2083 |
|
interlaced = 0; |
2084 |
|
} |
2085 |
|
|
2086 |
m_frame.bitstream = (BYTE*)m_frame.bitstream + length; |
m_frame.bitstream = (BYTE*)m_frame.bitstream + length; |
2087 |
m_frame.length -= length; |
m_frame.length -= length; |
2088 |
goto repeat; |
goto repeat; |
2185 |
|
|
2186 |
convert.width = m_create.width; |
convert.width = m_create.width; |
2187 |
convert.height = m_create.height; |
convert.height = m_create.height; |
2188 |
convert.interlacing = 0; |
convert.interlacing = (interlaced > 0) ? 1 : 0; |
2189 |
|
|
2190 |
if (m_frame.output.plane[1] != NULL && Dst != NULL && xvid_global_func != NULL) |
if (m_frame.output.plane[1] != NULL && Dst != NULL && xvid_global_func != NULL) |
2191 |
if (xvid_global_func(0, XVID_GBL_CONVERT, &convert, NULL) < 0) /* CSP convert into output buffer */ |
if (xvid_global_func(0, XVID_GBL_CONVERT, &convert, NULL) < 0) /* CSP convert into output buffer */ |