Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 955811b7 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "heif: renaming of grid-{width,height} to tile-{width,height}" into pi-dev am: 553a1a42

am: ea50f407

Change-Id: I87c192e4cf911a055985f0e99c896cf9d3f7ce89
parents cbc7e4b4 ea50f407
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1471,8 +1471,8 @@ sp<MetaData> ItemTable::getImageMeta(const uint32_t imageIndex) {

        // point image to the first tile for grid size and HVCC
        image = &mItemIdToItemMap.editValueAt(tileItemIndex);
        meta->setInt32(kKeyGridWidth, image->width);
        meta->setInt32(kKeyGridHeight, image->height);
        meta->setInt32(kKeyTileWidth, image->width);
        meta->setInt32(kKeyTileHeight, image->height);
        meta->setInt32(kKeyMaxInputSize, image->width * image->height * 1.5);
    }

+3 −3
Original line number Diff line number Diff line
@@ -56,10 +56,8 @@ static const char *AMediaFormatKeyGroupInt32[] = {
    AMEDIAFORMAT_KEY_COLOR_TRANSFER,
    AMEDIAFORMAT_KEY_COMPLEXITY,
    AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL,
    AMEDIAFORMAT_KEY_GRID_COLS,
    AMEDIAFORMAT_KEY_GRID_HEIGHT,
    AMEDIAFORMAT_KEY_GRID_COLUMNS,
    AMEDIAFORMAT_KEY_GRID_ROWS,
    AMEDIAFORMAT_KEY_GRID_WIDTH,
    AMEDIAFORMAT_KEY_HEIGHT,
    AMEDIAFORMAT_KEY_INTRA_REFRESH_PERIOD,
    AMEDIAFORMAT_KEY_IS_ADTS,
@@ -84,6 +82,8 @@ static const char *AMediaFormatKeyGroupInt32[] = {
    AMEDIAFORMAT_KEY_DISPLAY_HEIGHT,
    AMEDIAFORMAT_KEY_DISPLAY_WIDTH,
    AMEDIAFORMAT_KEY_TEMPORAL_LAYER_ID,
    AMEDIAFORMAT_KEY_TILE_HEIGHT,
    AMEDIAFORMAT_KEY_TILE_WIDTH,
    AMEDIAFORMAT_KEY_TRACK_INDEX,
};

+3 −3
Original line number Diff line number Diff line
@@ -211,11 +211,11 @@ enum {
    kKeyTemporalLayerId  = 'iLyr', // int32_t, temporal layer-id. 0-based (0 => base layer)
    kKeyTemporalLayerCount = 'cLyr', // int32_t, number of temporal layers encoded

    kKeyGridWidth        = 'grdW', // int32_t, HEIF grid width
    kKeyGridHeight       = 'grdH', // int32_t, HEIF grid height
    kKeyTileWidth        = 'tilW', // int32_t, HEIF tile width
    kKeyTileHeight       = 'tilH', // int32_t, HEIF tile height
    kKeyGridRows         = 'grdR', // int32_t, HEIF grid rows
    kKeyGridCols         = 'grdC', // int32_t, HEIF grid columns
    kKeyIccProfile       = 'prof', // raw data, ICC prifile data
    kKeyIccProfile       = 'prof', // raw data, ICC profile data
    kKeyIsPrimaryImage   = 'prim', // bool (int32_t), image track is the primary image
    kKeyFrameCount       = 'nfrm', // int32_t, total number of frame in video track
};
+7 −7
Original line number Diff line number Diff line
@@ -4384,9 +4384,9 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {

status_t ACodec::configureImageGrid(
        const sp<AMessage> &msg, sp<AMessage> &outputFormat) {
    int32_t gridWidth, gridHeight, gridRows, gridCols;
    if (!msg->findInt32("grid-width", &gridWidth) ||
        !msg->findInt32("grid-height", &gridHeight) ||
    int32_t tileWidth, tileHeight, gridRows, gridCols;
    if (!msg->findInt32("tile-width", &tileWidth) ||
        !msg->findInt32("tile-height", &tileHeight) ||
        !msg->findInt32("grid-rows", &gridRows) ||
        !msg->findInt32("grid-cols", &gridCols)) {
        return OK;
@@ -4396,8 +4396,8 @@ status_t ACodec::configureImageGrid(
    InitOMXParams(&gridType);
    gridType.nPortIndex = kPortIndexOutput;
    gridType.bEnabled = OMX_TRUE;
    gridType.nGridWidth = gridWidth;
    gridType.nGridHeight = gridHeight;
    gridType.nTileWidth = tileWidth;
    gridType.nTileHeight = tileHeight;
    gridType.nGridRows = gridRows;
    gridType.nGridCols = gridCols;

@@ -4422,8 +4422,8 @@ status_t ACodec::configureImageGrid(
            &gridType, sizeof(gridType));

    if (err == OK && gridType.bEnabled) {
        outputFormat->setInt32("grid-width", gridType.nGridWidth);
        outputFormat->setInt32("grid-height", gridType.nGridHeight);
        outputFormat->setInt32("tile-width", gridType.nTileWidth);
        outputFormat->setInt32("tile-height", gridType.nTileHeight);
        outputFormat->setInt32("grid-rows", gridType.nGridRows);
        outputFormat->setInt32("grid-cols", gridType.nGridCols);
    }
+10 −10
Original line number Diff line number Diff line
@@ -495,27 +495,27 @@ sp<AMessage> ImageDecoder::onGetFormatAndSeekOptions(
    mGridRows = mGridCols = 1;
    if (overrideMeta == NULL) {
        // check if we're dealing with a tiled heif
        int32_t gridWidth, gridHeight, gridRows, gridCols;
        if (trackMeta()->findInt32(kKeyGridWidth, &gridWidth) && gridWidth > 0
         && trackMeta()->findInt32(kKeyGridHeight, &gridHeight) && gridHeight > 0
        int32_t tileWidth, tileHeight, gridRows, gridCols;
        if (trackMeta()->findInt32(kKeyTileWidth, &tileWidth) && tileWidth > 0
         && trackMeta()->findInt32(kKeyTileHeight, &tileHeight) && tileHeight > 0
         && trackMeta()->findInt32(kKeyGridRows, &gridRows) && gridRows > 0
         && trackMeta()->findInt32(kKeyGridCols, &gridCols) && gridCols > 0) {
            int32_t width, height;
            CHECK(trackMeta()->findInt32(kKeyWidth, &width));
            CHECK(trackMeta()->findInt32(kKeyHeight, &height));

            if (width <= gridWidth * gridCols && height <= gridHeight * gridRows) {
                ALOGV("grid: %dx%d, size: %dx%d, picture size: %dx%d",
                        gridCols, gridRows, gridWidth, gridHeight, width, height);
            if (width <= tileWidth * gridCols && height <= tileHeight * gridRows) {
                ALOGV("grid: %dx%d, tile size: %dx%d, picture size: %dx%d",
                        gridCols, gridRows, tileWidth, tileHeight, width, height);

                overrideMeta = new MetaData(*(trackMeta()));
                overrideMeta->setInt32(kKeyWidth, gridWidth);
                overrideMeta->setInt32(kKeyHeight, gridHeight);
                overrideMeta->setInt32(kKeyWidth, tileWidth);
                overrideMeta->setInt32(kKeyHeight, tileHeight);
                mGridCols = gridCols;
                mGridRows = gridRows;
            } else {
                ALOGE("bad grid: %dx%d, size: %dx%d, picture size: %dx%d",
                        gridCols, gridRows, gridWidth, gridHeight, width, height);
                ALOGE("bad grid: %dx%d, tile size: %dx%d, picture size: %dx%d",
                        gridCols, gridRows, tileWidth, tileHeight, width, height);
            }
        }
        if (overrideMeta == NULL) {
Loading