On Thu, Oct 24, 2013 at 12:30 AM, Gopu Govindaswamy < g...@multicorewareinc.com> wrote:
> # HG changeset patch > # User Gopu Govindaswamy <g...@multicorewareinc.com> > # Date 1382592648 -19800 > # Node ID 153cfb6f7c4a51916ce4b732fae0ca29d6382ad0 > # Parent 0cb0692d6c69dbf6c5b49c51f6f528e29674baa9 > recon : seek position calculate and obtain to 64 bit precision variable > output: use 64bit file offsets to prevent overflow with 4k video > > diff -r 0cb0692d6c69 -r 153cfb6f7c4a source/output/y4m.cpp > --- a/source/output/y4m.cpp Wed Oct 23 20:09:33 2013 +0800 > +++ b/source/output/y4m.cpp Thu Oct 24 11:00:48 2013 +0530 > @@ -51,7 +51,12 @@ > { > PPAStartCpuEventFunc(write_yuv); > std::ofstream::pos_type outPicPos = header; > - outPicPos += pic.poc * (6 + 3 * (width * height) / 2); > + uint64_t size = (width * height); > + size *= 3; > + size += 6; > + size /= 2; > + size *= pic.poc; > + outPicPos += size; > uint64_t frameSize = (6 + 3 * (width * height) / 2); ofs.seekp(header + frameSize * pic.poc); > ofs.seekp(outPicPos); > ofs << "FRAME\n"; > > diff -r 0cb0692d6c69 -r 153cfb6f7c4a source/output/yuv.cpp > --- a/source/output/yuv.cpp Wed Oct 23 20:09:33 2013 +0800 > +++ b/source/output/yuv.cpp Thu Oct 24 11:00:48 2013 +0530 > @@ -47,7 +47,10 @@ > { > PPAStartCpuEventFunc(write_yuv); > int pixelbytes = (depth > 8) ? 2 : 1; > - ofs.seekp(pic.poc * 3 * (width * height * pixelbytes) / 2); > + uint64_t size = (pic.poc * 3); > + size *= (width * height * pixelbytes); > + size /= 2; > + ofs.seekp(size); > uint64_t frameSize = (6 + 3 * (width * height) / 2); ofs.seekp(frameSize * pic.poc); > if (pic.bitDepth > 8 && depth == 8) > { > _______________________________________________ > x265-devel mailing list > x265-devel@videolan.org > https://mailman.videolan.org/listinfo/x265-devel > -- Steve Borho
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel