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

Gopu Govindaswamy gopu at multicorewareinc.com
Thu Oct 24 07:30:58 CEST 2013


# 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

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;
     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);
 
     if (pic.bitDepth > 8 && depth == 8)
     {


More information about the x265-devel mailing list