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

Commit f64f80ec authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "heif: use width and height for decoder"

parents 9b64c465 1a6c1168
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -332,8 +332,8 @@ bool HeifDecoderImpl::init(HeifStream* stream, HeifFrameInfo* frameInfo) {

    if (frameInfo != nullptr) {
        frameInfo->set(
                videoFrame->mDisplayWidth,
                videoFrame->mDisplayHeight,
                videoFrame->mWidth,
                videoFrame->mHeight,
                videoFrame->mRotationAngle,
                videoFrame->mBytesPerPixel,
                videoFrame->mIccSize,
@@ -410,8 +410,8 @@ bool HeifDecoderImpl::decode(HeifFrameInfo* frameInfo) {

    if (frameInfo != nullptr) {
        frameInfo->set(
                videoFrame->mDisplayWidth,
                videoFrame->mDisplayHeight,
                videoFrame->mWidth,
                videoFrame->mHeight,
                videoFrame->mRotationAngle,
                videoFrame->mBytesPerPixel,
                videoFrame->mIccSize,
@@ -430,12 +430,12 @@ bool HeifDecoderImpl::getScanline(uint8_t* dst) {
        return false;
    }
    VideoFrame* videoFrame = static_cast<VideoFrame*>(mFrameMemory->pointer());
    if (mCurScanline >= videoFrame->mDisplayHeight) {
    if (mCurScanline >= videoFrame->mHeight) {
        ALOGE("no more scanline available");
        return false;
    }
    uint8_t* src = videoFrame->getFlattenedData() + videoFrame->mRowBytes * mCurScanline++;
    memcpy(dst, src, videoFrame->mBytesPerPixel * videoFrame->mDisplayWidth);
    memcpy(dst, src, videoFrame->mBytesPerPixel * videoFrame->mWidth);
    return true;
}

@@ -447,8 +447,8 @@ size_t HeifDecoderImpl::skipScanlines(size_t count) {

    uint32_t oldScanline = mCurScanline;
    mCurScanline += count;
    if (mCurScanline > videoFrame->mDisplayHeight) {
        mCurScanline = videoFrame->mDisplayHeight;
    if (mCurScanline > videoFrame->mHeight) {
        mCurScanline = videoFrame->mHeight;
    }
    return (mCurScanline > oldScanline) ? (mCurScanline - oldScanline) : 0;
}