[x265-commits] [x265] yuv: make file reading threaded

Kavitha Sampath kavitha at multicorewareinc.com
Wed Oct 16 23:36:42 CEST 2013


details:   http://hg.videolan.org/x265/rev/18c935330e9e
branches:  
changeset: 4481:18c935330e9e
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Wed Oct 16 11:00:38 2013 +0530
description:
yuv: make file reading threaded
Subject: [x265] cleanup: remove unused updateContextTables()

details:   http://hg.videolan.org/x265/rev/ad081b5f340f
branches:  
changeset: 4482:ad081b5f340f
user:      Min Chen <chenm003 at 163.com>
date:      Wed Oct 16 21:53:25 2013 +0800
description:
cleanup: remove unused updateContextTables()
Subject: [x265] intra-sse3.cpp: Remove unused vector class macros

details:   http://hg.videolan.org/x265/rev/ec5a816c4ef3
branches:  
changeset: 4483:ec5a816c4ef3
user:      Dnyaneshwar Gorade <dnyaneshwar at multicorewareinc.com>
date:      Wed Oct 16 11:14:43 2013 +0530
description:
intra-sse3.cpp: Remove unused vector class macros
Subject: [x265] no-rdo: remove unused checks

details:   http://hg.videolan.org/x265/rev/d45ce25752cf
branches:  
changeset: 4484:d45ce25752cf
user:      Sumalatha Polureddy
date:      Wed Oct 16 12:17:21 2013 +0530
description:
no-rdo: remove unused checks
Subject: [x265] primitive: chroma partition enums by full dimension and function pointers

details:   http://hg.videolan.org/x265/rev/08ecee513efc
branches:  
changeset: 4485:08ecee513efc
user:      Praveen Tiwari
date:      Wed Oct 16 20:23:47 2013 +0530
description:
primitive: chroma partition enums by full dimension and function pointers
Subject: [x265] primitive: added C primitive and unit test code for one chroma filter

details:   http://hg.videolan.org/x265/rev/762ca3c4b6f2
branches:  
changeset: 4486:762ca3c4b6f2
user:      Praveen Tiwari
date:      Wed Oct 16 20:30:59 2013 +0530
description:
primitive: added C primitive and unit test code for one chroma filter
Subject: [x265] asm: update chroma interpolation primitives

details:   http://hg.videolan.org/x265/rev/bc1399dbc2ed
branches:  
changeset: 4487:bc1399dbc2ed
user:      Praveen Tiwari
date:      Wed Oct 16 14:15:33 2013 -0500
description:
asm: update chroma interpolation primitives
Subject: [x265] bidir: fix for hash mismatch with B-frames

details:   http://hg.videolan.org/x265/rev/c415f32219fe
branches:  
changeset: 4488:c415f32219fe
user:      Deepthi Devaki <deepthidevaki at multicorewareinc.com>
date:      Wed Oct 16 16:49:50 2013 +0530
description:
bidir: fix for hash mismatch with B-frames

Use seperate variables for mvp and mvpidx used for zero mv candidates. Also copy
the corresponding AMVPinfo for each reflist/refIdx.
Subject: [x265] api: add x265_param_parse() function based on x264_param_parse()

details:   http://hg.videolan.org/x265/rev/69d8796e57e4
branches:  
changeset: 4489:69d8796e57e4
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Wed Oct 16 11:43:31 2013 +0530
description:
api: add x265_param_parse() function based on x264_param_parse()
Subject: [x265] cli: implemented do_help() without using x265opts.h

details:   http://hg.videolan.org/x265/rev/9347808f2f9b
branches:  
changeset: 4490:9347808f2f9b
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Wed Oct 16 14:48:52 2013 +0530
description:
cli: implemented do_help() without using x265opts.h
Subject: [x265] cli: long_options structure initialization without using x265opts.h

details:   http://hg.videolan.org/x265/rev/1cf1fe777d14
branches:  
changeset: 4491:1cf1fe777d14
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Wed Oct 16 15:58:35 2013 +0530
description:
cli: long_options structure initialization without using x265opts.h
Subject: [x265] cli: remove unused x265opts.h

details:   http://hg.videolan.org/x265/rev/9317198e26e2
branches:  
changeset: 4492:9317198e26e2
user:      Gopu Govindaswamy <gopu at multicorewareinc.com>
date:      Wed Oct 16 16:06:12 2013 +0530
description:
cli: remove unused x265opts.h
Subject: [x265] pass bLuma and bChroma parameters for functions

details:   http://hg.videolan.org/x265/rev/872e98c8bc7b
branches:  
changeset: 4493:872e98c8bc7b
user:      Sumalatha Polureddy
date:      Wed Oct 16 17:18:19 2013 +0530
description:
pass bLuma and bChroma parameters for functions

Based on the values of two parameters, luma and chroma operations are done.
Default value for both is set as true todo both operations
Subject: [x265] build: wtf is a Visual Studion?

details:   http://hg.videolan.org/x265/rev/798f12a3ca4c
branches:  
changeset: 4494:798f12a3ca4c
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 16 15:27:51 2013 -0500
description:
build: wtf is a Visual Studion?
Subject: [x265] cli: pull CLIOptions methods out of struct definition (cleanup)

details:   http://hg.videolan.org/x265/rev/5c258896b571
branches:  
changeset: 4495:5c258896b571
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 16 15:50:51 2013 -0500
description:
cli: pull CLIOptions methods out of struct definition (cleanup)

Remove i_ hungarian notation from variables
Subject: [x265] cli: tighten up command line help, remove redundancies and save whitespace

details:   http://hg.videolan.org/x265/rev/f7d1914d1f61
branches:  
changeset: 4496:f7d1914d1f61
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 16 16:15:41 2013 -0500
description:
cli: tighten up command line help, remove redundancies and save whitespace
Subject: [x265] check_IPFilterChroma_primitive, stride made equal to min width 2

details:   http://hg.videolan.org/x265/rev/89a299c198d0
branches:  
changeset: 4497:89a299c198d0
user:      Praveen Tiwari
date:      Wed Oct 16 21:10:13 2013 +0530
description:
check_IPFilterChroma_primitive, stride made equal to min width 2

short-term workaround for 2XN blocks
Subject: [x265] primitives: do not include the public API header in primitives.h

details:   http://hg.videolan.org/x265/rev/5e269e353bc6
branches:  
changeset: 4498:5e269e353bc6
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 16 16:29:32 2013 -0500
description:
primitives: do not include the public API header in primitives.h

This was necessary in the past for the CPU level enums but those are now gone.
Only vec-primitives.cpp and asm-primitives.cpp need the CPU capability defines
and they can include x265.h themselves.

diffstat:

 build/vc10-x86/make-solutions.bat              |    2 +-
 build/vc10-x86_64/make-solutions.bat           |    2 +-
 build/vc11-x86/make-solutions.bat              |    2 +-
 build/vc11-x86_64/make-solutions.bat           |    2 +-
 build/vc9-x86/make-solutions.bat               |    2 +-
 build/vc9-x86_64/make-solutions.bat            |    2 +-
 source/CMakeLists.txt                          |    2 +-
 source/Lib/TLibCommon/TComPrediction.cpp       |   80 +-
 source/Lib/TLibCommon/TComPrediction.h         |   10 +-
 source/Lib/TLibCommon/TComWeightPrediction.cpp |  529 ++++++++-------
 source/Lib/TLibCommon/TComWeightPrediction.h   |   16 +-
 source/Lib/TLibCommon/TComYuv.cpp              |  218 +++---
 source/Lib/TLibCommon/TComYuv.h                |    8 +-
 source/Lib/TLibEncoder/TEncCavlc.h             |    4 -
 source/Lib/TLibEncoder/TEncCu.cpp              |    8 -
 source/Lib/TLibEncoder/TEncEntropy.h           |    6 -
 source/Lib/TLibEncoder/TEncSbac.cpp            |   37 -
 source/Lib/TLibEncoder/TEncSbac.h              |    3 -
 source/Lib/TLibEncoder/TEncSearch.cpp          |   37 +-
 source/Lib/TLibEncoder/TEncSearch.h            |    2 +-
 source/common/common.cpp                       |  121 +++
 source/common/ipfilter.cpp                     |   73 ++
 source/common/primitives.h                     |   24 +-
 source/common/vec/intra-sse3.cpp               |   49 -
 source/common/vec/vec-primitives.cpp           |    1 +
 source/common/x86/asm-primitives.cpp           |   59 +-
 source/common/x86/ipfilter8.asm                |  497 +++++++++++++--
 source/input/yuv.cpp                           |  136 +++-
 source/input/yuv.h                             |   43 +-
 source/test/ipfilterharness.cpp                |   57 +
 source/test/ipfilterharness.h                  |    1 +
 source/x265.cpp                                |  791 ++++++++++++++----------
 source/x265.def.in                             |    1 +
 source/x265.h                                  |   11 +
 source/x265opts.h                              |  103 ---
 35 files changed, 1859 insertions(+), 1080 deletions(-)

diffs (truncated from 3894 to 300 lines):

diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc10-x86/make-solutions.bat
--- a/build/vc10-x86/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc10-x86/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 10" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc10-x86_64/make-solutions.bat
--- a/build/vc10-x86_64/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc10-x86_64/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 10 Win64" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc11-x86/make-solutions.bat
--- a/build/vc11-x86/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc11-x86/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 11" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc11-x86_64/make-solutions.bat
--- a/build/vc11-x86_64/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc11-x86_64/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 11 Win64" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc9-x86/make-solutions.bat
--- a/build/vc9-x86/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc9-x86/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 9 2008" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 build/vc9-x86_64/make-solutions.bat
--- a/build/vc9-x86_64/make-solutions.bat	Wed Oct 16 02:35:57 2013 -0500
+++ b/build/vc9-x86_64/make-solutions.bat	Wed Oct 16 16:29:32 2013 -0500
@@ -1,6 +1,6 @@
 @echo off
 ::
-:: run this batch file to create a Visual Studion solution file for this project.
+:: run this batch file to create a Visual Studio solution file for this project.
 :: See the cmake documentation for other generator targets
 ::
 cmake -G "Visual Studio 9 2008 Win64" ..\..\source && cmake-gui ..\..\source
diff -r 4b1716b232e5 -r 5e269e353bc6 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Wed Oct 16 02:35:57 2013 -0500
+++ b/source/CMakeLists.txt	Wed Oct 16 16:29:32 2013 -0500
@@ -211,7 +211,7 @@ if(ENABLE_CLI)
     endif()
 
     add_executable(cli ../COPYING ${InputFiles} ${OutputFiles}
-                   x265.cpp x265opts.h x265.h
+                   x265.cpp x265.h
                    compat/msvc/getopt.c compat/msvc/getopt.h)
     target_link_libraries(cli x265-static ${PLATFORM_LIBS})
     set_target_properties(cli PROPERTIES OUTPUT_NAME x265)
diff -r 4b1716b232e5 -r 5e269e353bc6 source/Lib/TLibCommon/TComPrediction.cpp
--- a/source/Lib/TLibCommon/TComPrediction.cpp	Wed Oct 16 02:35:57 2013 -0500
+++ b/source/Lib/TLibCommon/TComPrediction.cpp	Wed Oct 16 16:29:32 2013 -0500
@@ -245,7 +245,7 @@ bool TComPrediction::xCheckIdenticalMoti
     return false;
 }
 
-void TComPrediction::motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList, int partIdx)
+void TComPrediction::motionCompensation(TComDataCU* cu, TComYuv* predYuv, RefPicList picList, int partIdx, bool bLuma, bool bChroma)
 {
     int  width;
     int  height;
@@ -264,26 +264,27 @@ void TComPrediction::motionCompensation(
 
                 MV mv = cu->getCUMvField(picList)->getMv(partAddr);
                 cu->clipMv(mv);
+                if (bLuma)
+                    xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
+                if (bChroma)
+                    xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
 
-                xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
-                xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
-
-                xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv);
+                xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv, bLuma, bChroma);
             }
             else
             {
-                xPredInterUni(cu, partAddr, width, height, picList, predYuv);
+                xPredInterUni(cu, partAddr, width, height, picList, predYuv, bLuma, bChroma);
             }
         }
         else
         {
             if (xCheckIdenticalMotion(cu, partAddr))
             {
-                xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv);
+                xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv, bLuma, bChroma);
             }
             else
             {
-                xPredInterBi(cu, partAddr, width, height, predYuv);
+                xPredInterBi(cu, partAddr, width, height, predYuv, bLuma, bChroma);
             }
         }
         return;
@@ -305,31 +306,33 @@ void TComPrediction::motionCompensation(
                 MV mv = cu->getCUMvField(picList)->getMv(partAddr);
                 cu->clipMv(mv);
 
-                xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
-                xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
+                if (bLuma)
+                    xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
+                if (bChroma)
+                    xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
 
-                xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv);
+                xWeightedPredictionUni(cu, pcMbYuv, partAddr, width, height, picList, predYuv, bLuma, bChroma);
             }
             else
             {
-                xPredInterUni(cu, partAddr, width, height, picList, predYuv);
+                xPredInterUni(cu, partAddr, width, height, picList, predYuv, bLuma, bChroma);
             }
         }
         else
         {
             if (xCheckIdenticalMotion(cu, partAddr))
             {
-                xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv);
+                xPredInterUni(cu, partAddr, width, height, REF_PIC_LIST_0, predYuv, bLuma, bChroma);
             }
             else
             {
-                xPredInterBi(cu, partAddr, width, height, predYuv);
+                xPredInterBi(cu, partAddr, width, height, predYuv, bLuma, bChroma);
             }
         }
     }
 }
 
-void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv)
+void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv, bool bLuma, bool bChroma)
 {
     int refIdx = cu->getCUMvField(picList)->getRefIdx(partAddr);
 
@@ -338,12 +341,14 @@ void TComPrediction::xPredInterUni(TComD
     MV mv = cu->getCUMvField(picList)->getMv(partAddr);
     cu->clipMv(mv);
 
-    xPredInterLumaBlk(cu, cu->getSlice()->m_mref[picList][refIdx], partAddr, &mv, width, height, outPredYuv);
+    if (bLuma)
+        xPredInterLumaBlk(cu, cu->getSlice()->m_mref[picList][refIdx], partAddr, &mv, width, height, outPredYuv);
 
-    xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
+    if (bChroma)
+        xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
 }
 
-void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv)
+void TComPrediction::xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv, bool bLuma, bool bChroma)
 {
     int refIdx = cu->getCUMvField(picList)->getRefIdx(partAddr);
 
@@ -352,11 +357,13 @@ void TComPrediction::xPredInterUni(TComD
     MV mv = cu->getCUMvField(picList)->getMv(partAddr);
     cu->clipMv(mv);
 
-    xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
-    xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
+    if (bLuma)
+        xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
+    if (bChroma)
+        xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refIdx)->getPicYuvRec(), partAddr, &mv, width, height, outPredYuv);
 }
 
-void TComPrediction::xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv)
+void TComPrediction::xPredInterBi(TComDataCU* cu, UInt partAddr, int width, int height, TComYuv*& outPredYuv, bool bLuma, bool bChroma)
 {
     int refIdx[2] = { -1, -1 };
 
@@ -371,16 +378,16 @@ void TComPrediction::xPredInterBi(TComDa
             assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));
 
             pcMbYuv = &m_predShortYuv[refList];
-            xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv);
+            xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv, bLuma, bChroma);
         }
 
         if (cu->getSlice()->getPPS()->getWPBiPred() && cu->getSlice()->getSliceType() == B_SLICE)
         {
-            xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);
+            xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);
         }
         else
         {
-            outPredYuv->addAvg(&m_predShortYuv[0], &m_predShortYuv[1], partAddr, width, height);
+            outPredYuv->addAvg(&m_predShortYuv[0], &m_predShortYuv[1], partAddr, width, height, bLuma, bChroma);
         }
     }
     else if (cu->getSlice()->getPPS()->getWPBiPred() && cu->getSlice()->getSliceType() == B_SLICE)
@@ -399,10 +406,10 @@ void TComPrediction::xPredInterBi(TComDa
             assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));
 
             pcMbYuv = &m_predShortYuv[refList];
-            xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv);
+            xPredInterUni(cu, partAddr, width, height, picList, pcMbYuv, bLuma, bChroma);
         }
 
-        xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);
+        xWeightedPredictionBi(cu, &m_predShortYuv[0], &m_predShortYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);
     }
     else if (cu->getSlice()->getPPS()->getUseWP() && cu->getSlice()->getSliceType() == P_SLICE)
     {
@@ -421,11 +428,12 @@ void TComPrediction::xPredInterBi(TComDa
 
             MV mv = cu->getCUMvField(picList)->getMv(partAddr);
             cu->clipMv(mv);
+            if (bLuma)
+                xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
+            if (bChroma)
+                xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
 
-            xPredInterLumaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
-            xPredInterChromaBlk(cu, cu->getSlice()->getRefPic(picList, refId)->getPicYuvRec(), partAddr, &mv, width, height, pcMbYuv);
-
-            xWeightedPredictionUni(cu, &m_predShortYuv[0], partAddr, width, height, REF_PIC_LIST_0, outPredYuv);
+            xWeightedPredictionUni(cu, &m_predShortYuv[0], partAddr, width, height, REF_PIC_LIST_0, outPredYuv, bLuma, bChroma);
         }
     }
     else
@@ -443,10 +451,10 @@ void TComPrediction::xPredInterBi(TComDa
             assert(refIdx[refList] < cu->getSlice()->getNumRefIdx(picList));
 
             TComYuv* yuv = &m_predYuv[refList];
-            xPredInterUni(cu, partAddr, width, height, picList, yuv);
+            xPredInterUni(cu, partAddr, width, height, picList, yuv, bLuma, bChroma);
         }
 
-        xWeightedAverage(&m_predYuv[0], &m_predYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv);
+        xWeightedAverage(&m_predYuv[0], &m_predYuv[1], refIdx[0], refIdx[1], partAddr, width, height, outPredYuv, bLuma, bChroma);
     }
 }
 
@@ -635,19 +643,19 @@ void TComPrediction::xPredInterChromaBlk
     }
 }
 
-void TComPrediction::xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv*& outDstYuv)
+void TComPrediction::xWeightedAverage(TComYuv* srcYuv0, TComYuv* srcYuv1, int refIdx0, int refIdx1, UInt partIdx, int width, int height, TComYuv*& outDstYuv, bool bLuma, bool bChroma)
 {
     if (refIdx0 >= 0 && refIdx1 >= 0)
     {
-        outDstYuv->addAvg(srcYuv0, srcYuv1, partIdx, width, height);
+        outDstYuv->addAvg(srcYuv0, srcYuv1, partIdx, width, height, bLuma, bChroma);
     }
     else if (refIdx0 >= 0 && refIdx1 <  0)
     {
-        srcYuv0->copyPartToPartYuv(outDstYuv, partIdx, width, height);
+        srcYuv0->copyPartToPartYuv(outDstYuv, partIdx, width, height, bLuma, bChroma);
     }
     else if (refIdx0 <  0 && refIdx1 >= 0)
     {
-        srcYuv1->copyPartToPartYuv(outDstYuv, partIdx, width, height);
+        srcYuv1->copyPartToPartYuv(outDstYuv, partIdx, width, height, bLuma, bChroma);
     }
 }
 
diff -r 4b1716b232e5 -r 5e269e353bc6 source/Lib/TLibCommon/TComPrediction.h
--- a/source/Lib/TLibCommon/TComPrediction.h	Wed Oct 16 02:35:57 2013 -0500
+++ b/source/Lib/TLibCommon/TComPrediction.h	Wed Oct 16 16:29:32 2013 -0500
@@ -83,15 +83,15 @@ protected:
     int       m_lumaRecStride; ///< stride of m_lumaRecBuffer
 
     // motion compensation functions
-    void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv);
-    void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv);
+    void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TComYuv* outPredYuv, bool bLuma = true, bool bChroma = true);
+    void xPredInterUni(TComDataCU* cu, UInt partAddr, int width, int height, RefPicList picList, TShortYUV* outPredYuv, bool bLuma = true, bool bChroma = true);
     void xPredInterLumaBlk(TComDataCU *cu, MotionReference *refPic, UInt partAddr, MV *mv, int width, int height, TComYuv *dstPic);


More information about the x265-commits mailing list