Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions source/abrEncApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,12 +830,13 @@ namespace X265_NS {

if (pic_in[view]->framesize)
{
bool bBff = m_param->interlaceMode == 2;
for (int i = 0; i < x265_cli_csps[pic_in[view]->colorSpace].planes; i++)
{
char* srcP1 = (char*)pic_in[view]->planes[i];
char* srcP2 = (char*)pic_in[view]->planes[i] + pic_in[view]->stride[i];
char* p1 = (char*)picField1.planes[i];
char* p2 = (char*)picField2.planes[i];
char* srcP1 = static_cast<char*>(pic_in[view]->planes[i]) + (bBff ? pic_in[view]->stride[i] : 0);
char* srcP2 = static_cast<char*>(pic_in[view]->planes[i]) + (bBff ? 0 : pic_in[view]->stride[i]);
char* p1 = static_cast<char*>(picField1.planes[i]);
char* p2 = static_cast<char*>(picField2.planes[i]);

int stride = picField1.stride[i];

Expand Down Expand Up @@ -970,8 +971,11 @@ namespace X265_NS {
int numEncoded = api->encoder_encode(m_encoder, &p_nal, &nal, picInput, pic_recon);

int idx = (inFrameCount - 1) % m_parent->m_queueSize;
m_parent->m_picIdxReadCnt[m_id][idx].incr();
m_parent->m_picReadCnt[m_id].incr();
if (inputNum == inputPicNum - 1)
{
m_parent->m_picIdxReadCnt[m_id][idx].incr();
m_parent->m_picReadCnt[m_id].incr();
}
if (m_cliopt.loadLevel && picInput)
{
m_parent->m_analysisReadCnt[m_cliopt.refId].incr();
Expand Down
9 changes: 4 additions & 5 deletions source/encoder/frameencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,19 +804,18 @@ void FrameEncoder::compressFrame(int layer)
{
if (m_param->interlaceMode > 0)
{
// field_seq_flag is 1, so each picture is a single field: 1 = top field, 2 = bottom field
if( m_param->interlaceMode == 2 )
{
// m_picStruct should be set to 3 or 4 when field feature is enabled
{
if (m_param->bField)
// 3: Top field, bottom field, in that order; 4: Bottom field, top field, in that order
sei->m_picStruct = (slice->m_fieldNum == 1) ? 4 : 3;
sei->m_picStruct = (slice->m_fieldNum == 1) ? 2 /* bottom */ : 1 /* top */;
else
sei->m_picStruct = (poc & 1) ? 1 /* top */ : 2 /* bottom */;
}
else if (m_param->interlaceMode == 1)
{
if (m_param->bField)
sei->m_picStruct = (slice->m_fieldNum == 1) ? 3: 4;
sei->m_picStruct = (slice->m_fieldNum == 1) ? 1 /* top */ : 2 /* bottom */;
else
sei->m_picStruct = (poc & 1) ? 2 /* bottom */ : 1 /* top */;
}
Expand Down
Loading