Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
TAiGA committed Mar 19, 2021
1 parent 534a675 commit c999d27
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libyuv
Submodule libyuv updated from 1837f0 to f37014
29 changes: 23 additions & 6 deletions plugin/yuv/yuv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define LIBYUV 1
#if defined(LIBYUV)
#include <libyuv.h>
#include <libyuv/convert_argb.h>
#endif

#define PLUGIN_NAME "YUV"
Expand Down Expand Up @@ -343,8 +344,12 @@ pluginAPI void Update(const UpdateData& updateData)
#if LIBYUV
if (libyuv)
{
auto converter = decodeFullRange ? libyuv::J420ToARGB : libyuv::I420ToARGB;
converter(lennaYU12, lennaWidth, lennaYU12 + sizeY, lennaWidth / 2, lennaYU12 + sizeY + sizeUV, lennaWidth / 2, temp, lennaWidth * 4, lennaWidth, lennaHeight);
libyuv::I420ToARGBMatrix(lennaYU12, lennaWidth,
lennaYU12 + sizeY, lennaWidth / 2,
lennaYU12 + sizeY + sizeUV, lennaWidth / 2,
temp, lennaWidth * 4,
decodeFullRange ? &libyuv::kYuvF709Constants : &libyuv::kYuvH709Constants,
lennaWidth, lennaHeight);
break;
}
#endif
Expand Down Expand Up @@ -399,8 +404,12 @@ pluginAPI void Update(const UpdateData& updateData)
#if LIBYUV
if (libyuv)
{
auto converter = decodeFullRange ? libyuv::J420ToARGB : libyuv::I420ToARGB;
converter(lennaYV12, lennaWidth, lennaYV12 + sizeY + sizeUV, lennaWidth / 2, lennaYV12 + sizeY, lennaWidth / 2, temp, lennaWidth * 4, lennaWidth, lennaHeight);
libyuv::I420ToARGBMatrix(lennaYV12, lennaWidth,
lennaYV12 + sizeY + sizeUV, lennaWidth / 2,
lennaYV12 + sizeY, lennaWidth / 2,
temp, lennaWidth * 4,
decodeFullRange ? &libyuv::kYuvF709Constants : &libyuv::kYuvH709Constants,
lennaWidth, lennaHeight);
break;
}
#endif
Expand Down Expand Up @@ -455,7 +464,11 @@ pluginAPI void Update(const UpdateData& updateData)
#if LIBYUV
if (libyuv)
{
libyuv::NV12ToARGB(lennaNV12, lennaWidth, lennaNV12 + sizeY, lennaWidth, temp, lennaWidth * 4, lennaWidth, lennaHeight);
libyuv::NV12ToARGBMatrix(lennaNV12, lennaWidth,
lennaNV12 + sizeY, lennaWidth,
temp, lennaWidth * 4,
decodeFullRange ? &libyuv::kYuvF709Constants : &libyuv::kYuvH709Constants,
lennaWidth, lennaHeight);
break;
}
#endif
Expand Down Expand Up @@ -509,7 +522,11 @@ pluginAPI void Update(const UpdateData& updateData)
#if LIBYUV
if (libyuv)
{
libyuv::NV21ToARGB(lennaNV21, lennaWidth, lennaNV21 + sizeY, lennaWidth, temp, lennaWidth * 4, lennaWidth, lennaHeight);
libyuv::NV21ToARGBMatrix(lennaNV21, lennaWidth,
lennaNV21 + sizeY, lennaWidth,
temp, lennaWidth * 4,
decodeFullRange ? &libyuv::kYuvF709Constants : &libyuv::kYuvH709Constants,
lennaWidth, lennaHeight);
break;
}
#endif
Expand Down
1 change: 1 addition & 0 deletions plugin/yuv/yuv.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\libyuv\source\scale_uv.cc" />
<ClCompile Include="..\..\libyuv\source\scale_win.cc" />
<ClCompile Include="..\..\libyuv\source\video_common.cc" />
<ClCompile Include="..\..\xxYUV\rgb2yuv.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions plugin/yuv/yuv.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
<ClCompile Include="..\..\libyuv\source\scale_neon64.cc">
<Filter>libyuv</Filter>
</ClCompile>
<ClCompile Include="..\..\libyuv\source\scale_uv.cc">
<Filter>libyuv</Filter>
</ClCompile>
<ClCompile Include="..\..\libyuv\source\scale_win.cc">
<Filter>libyuv</Filter>
</ClCompile>
Expand Down
10 changes: 10 additions & 0 deletions plugin/yuv/yuv.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@
CE8A73582604526500AEFD2B /* xxGraphic.dll in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8A73572604526500AEFD2B /* xxGraphic.dll */; };
CE8A735A2604526D00AEFD2B /* libxxGraphic.android in Frameworks */ = {isa = PBXBuildFile; fileRef = CE8A73592604526D00AEFD2B /* libxxGraphic.android */; };
CE8A73AE2604567400AEFD2B /* yuv.dll in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE8A711B260443CD00AEFD2B /* yuv.dll */; };
CEA24D5826048B9B005DBA21 /* scale_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = CEA24D5726048B9B005DBA21 /* scale_uv.cc */; };
CEA24D5926048B9B005DBA21 /* scale_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = CEA24D5726048B9B005DBA21 /* scale_uv.cc */; };
CEA24D5A26048B9B005DBA21 /* scale_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = CEA24D5726048B9B005DBA21 /* scale_uv.cc */; };
CEA24D5B26048B9C005DBA21 /* scale_uv.cc in Sources */ = {isa = PBXBuildFile; fileRef = CEA24D5726048B9B005DBA21 /* scale_uv.cc */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -331,6 +335,7 @@
CE8A731B26044A5B00AEFD2B /* libimgui.android */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libimgui.android; sourceTree = BUILT_PRODUCTS_DIR; };
CE8A73572604526500AEFD2B /* xxGraphic.dll */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = xxGraphic.dll; sourceTree = BUILT_PRODUCTS_DIR; };
CE8A73592604526D00AEFD2B /* libxxGraphic.android */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libxxGraphic.android; sourceTree = BUILT_PRODUCTS_DIR; };
CEA24D5726048B9B005DBA21 /* scale_uv.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scale_uv.cc; path = ../../libyuv/source/scale_uv.cc; sourceTree = "<group>"; };
D6022C3523258B5D00B9BFB8 /* libyuv.bundle */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyuv.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
D644A041231ED82900B75B77 /* libyuv.dylib */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libyuv.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
D6812B472602F014001436B7 /* apple_amx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = apple_amx.h; path = ../../xxYUV/apple_amx.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -459,6 +464,7 @@
CE4E3E10244E7CFA00CEDC62 /* scale_msa.cc */,
CE4E3E25244E7CFC00CEDC62 /* scale_neon.cc */,
CE4E3E27244E7CFC00CEDC62 /* scale_neon64.cc */,
CEA24D5726048B9B005DBA21 /* scale_uv.cc */,
CE4E3E2A244E7CFC00CEDC62 /* scale_win.cc */,
CE4E3E12244E7CFB00CEDC62 /* scale.cc */,
CE4E3E2B244E7CFD00CEDC62 /* video_common.cc */,
Expand Down Expand Up @@ -708,6 +714,7 @@
CE8A71AD260446B600AEFD2B /* scale_msa.cc in Sources */,
CE8A71AE260446B600AEFD2B /* scale_neon.cc in Sources */,
CE8A71AF260446B600AEFD2B /* scale_neon64.cc in Sources */,
CEA24D5A26048B9B005DBA21 /* scale_uv.cc in Sources */,
CE8A71B0260446B600AEFD2B /* scale_win.cc in Sources */,
CE8A71B1260446B600AEFD2B /* scale.cc in Sources */,
CE8A71B2260446B600AEFD2B /* video_common.cc in Sources */,
Expand Down Expand Up @@ -768,6 +775,7 @@
CE8A729B2604482300AEFD2B /* scale_msa.cc in Sources */,
CE8A729C2604482300AEFD2B /* scale_neon.cc in Sources */,
CE8A729D2604482300AEFD2B /* scale_neon64.cc in Sources */,
CEA24D5B26048B9C005DBA21 /* scale_uv.cc in Sources */,
CE8A729E2604482300AEFD2B /* scale_win.cc in Sources */,
CE8A729F2604482300AEFD2B /* scale.cc in Sources */,
CE8A72A02604482300AEFD2B /* video_common.cc in Sources */,
Expand Down Expand Up @@ -827,6 +835,7 @@
CE8A721B260447D300AEFD2B /* scale_msa.cc in Sources */,
CE8A721C260447D300AEFD2B /* scale_neon.cc in Sources */,
CE8A721D260447D300AEFD2B /* scale_neon64.cc in Sources */,
CEA24D5926048B9B005DBA21 /* scale_uv.cc in Sources */,
CE8A721E260447D300AEFD2B /* scale_win.cc in Sources */,
CE8A721F260447D300AEFD2B /* scale.cc in Sources */,
CE8A7220260447D400AEFD2B /* video_common.cc in Sources */,
Expand Down Expand Up @@ -886,6 +895,7 @@
CE8A7257260447E600AEFD2B /* scale_msa.cc in Sources */,
CE8A7258260447E600AEFD2B /* scale_neon.cc in Sources */,
CE8A7259260447E600AEFD2B /* scale_neon64.cc in Sources */,
CEA24D5826048B9B005DBA21 /* scale_uv.cc in Sources */,
CE8A725A260447E600AEFD2B /* scale_win.cc in Sources */,
CE8A725B260447E600AEFD2B /* scale.cc in Sources */,
CE8A725C260447E600AEFD2B /* video_common.cc in Sources */,
Expand Down

0 comments on commit c999d27

Please sign in to comment.