[x265] [PATCH] recon : seek position calculate and obtain to 64 bit precision variable

Steve Borho steve at borho.org
Thu Oct 24 09:58:34 CEST 2013


On Thu, Oct 24, 2013 at 12:30 AM, Gopu Govindaswamy <
gopu at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Gopu Govindaswamy <gopu at 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 at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131024/d5fc2760/attachment.html>


More information about the x265-devel mailing list