Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 5de7ff1

Browse files
zhang-shizhaoU1X6WK
authored andcommitted
Enable handling of bitstreams whose frame width and height are not 64-divisible and come with padding (#47)
1 parent bcffc20 commit 5de7ff1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/360SCVP/360SCVPHevcTilestream.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "360SCVPHevcEncHdr.h"
3232
#include "360SCVPTiledstreamAPI.h"
3333
#include "360SCVPLog.h"
34+
#define ALIGN64(X) ((uint32_t)(((uint32_t)(X))+63) & (uint32_t)(~ (uint32_t)63))
3435

3536
int32_t hevc_import_ffextradata(hevc_specialInfo* pSpecialInfo, HEVCState* hevc, uint32_t *pSize, int32_t *spsCnt, int32_t *audCnt, int32_t bParse)
3637
{
@@ -281,8 +282,8 @@ int32_t parse_tiles_info(hevc_gen_tiledstream* pGenTilesStream)
281282
if(nalsize[SEQ_PARAM_SET])
282283
{
283284
HEVC_SPS *sps = &pSliceCur->hevcSlice->sps[pSliceCur->hevcSlice->last_parsed_sps_id];
284-
pSliceCur->width = sps->width;
285-
pSliceCur->height = sps->height;
285+
pSliceCur->width = ALIGN64(sps->width);
286+
pSliceCur->height = ALIGN64(sps->height);
286287
}
287288
/*
288289
if(pSliceCur->width != (pGenTilesStream->frameWidth / tilesWidthCount)

0 commit comments

Comments
 (0)