feat: select fourcc and handle hw decoded
Clang Build CI / build-release (push) Failing after 54s
Clang Build CI / run-video (push) Successful in 1m12s
Clang Lint CI / lint-no-video (push) Successful in 1m12s
Clang Build CI / run-no-video (push) Successful in 1m17s
Clang Lint CI / lint-video (push) Successful in 4m33s
Clang Build CI / build-release (push) Failing after 54s
Clang Build CI / run-video (push) Successful in 1m12s
Clang Lint CI / lint-no-video (push) Successful in 1m12s
Clang Build CI / run-no-video (push) Successful in 1m17s
Clang Lint CI / lint-video (push) Successful in 4m33s
This commit is contained in:
@@ -269,7 +269,7 @@ GROUP_3_1_Y=58
|
||||
GROUP_3_1_Z=
|
||||
GROUP_3_2_X=0
|
||||
GROUP_3_2_Y=16
|
||||
GROUP_3_2_Z=
|
||||
GROUP_3_2_Z=11089
|
||||
|
||||
# =====
|
||||
# OTHER
|
||||
|
||||
+4
-1
@@ -15,9 +15,12 @@ uniform sampler2D iTex1;
|
||||
uniform sampler2D iTex3;
|
||||
uniform int iInputFormat1;
|
||||
uniform vec2 iInputResolution1;
|
||||
uniform vec3 iGroup3_1[2];
|
||||
|
||||
void main() {
|
||||
if (iInputFormat1 == YUYV_FOURCC) {
|
||||
if (iGroup3_1[1].z > 0) {
|
||||
fragColor = texture(iTex1, vUV * vec2(1, -1));
|
||||
} else if (iInputFormat1 == YUYV_FOURCC) {
|
||||
fragColor = yuyvTex(iTex1, vUV, int(iInputResolution1.x));
|
||||
} else {
|
||||
fragColor = texture(iTex0, vUV);
|
||||
|
||||
+4
-1
@@ -15,9 +15,12 @@ uniform sampler2D iTex2;
|
||||
uniform sampler2D iTex4;
|
||||
uniform int iInputFormat2;
|
||||
uniform vec2 iInputResolution2;
|
||||
uniform vec3 iGroup3_1[2];
|
||||
|
||||
void main() {
|
||||
if (iInputFormat2 == YUYV_FOURCC) {
|
||||
if (iGroup3_1[1].z > 0) {
|
||||
fragColor = texture(iTex2, vUV * vec2(1, -1));
|
||||
} else if (iInputFormat2 == YUYV_FOURCC) {
|
||||
fragColor = yuyvTex(iTex2, vUV, int(iInputResolution2.x));
|
||||
} else {
|
||||
fragColor = texture(iTex0, vUV);
|
||||
|
||||
+23
-7
@@ -3,11 +3,27 @@
|
||||
|
||||
const int YUYV_FOURCC = 1448695129;
|
||||
|
||||
const mat3x3 yuyv_to_rgb = {{1,1,1},{0,-0.39465,2.03211},{1.13983,-0.5806,0}};
|
||||
// https://en.wikipedia.org/wiki/Y%E2%80%B2UV
|
||||
const mat3x3 yuyv_to_rgb_bt709 = {
|
||||
{
|
||||
1,
|
||||
1,
|
||||
1
|
||||
},
|
||||
{
|
||||
0,
|
||||
-0.21482,
|
||||
2.12798
|
||||
},
|
||||
{
|
||||
1.28033,
|
||||
-0.38059,
|
||||
0
|
||||
}
|
||||
};
|
||||
|
||||
vec4 yuyvTex(sampler2D tex, vec2 vUV, int base_width) {
|
||||
float w = base_width - 1;
|
||||
|
||||
int x = int(vUV.x * w);
|
||||
|
||||
int xU = x - x % 2;
|
||||
@@ -17,12 +33,12 @@ vec4 yuyvTex(sampler2D tex, vec2 vUV, int base_width) {
|
||||
vec4 tV = texture(tex, vec2(xV / w, 1 - vUV.y));
|
||||
|
||||
vec3 yuv = vec3(
|
||||
x % 2 == 0 ? tU.x : tV.x,
|
||||
tU.y - 0.5,
|
||||
tV.y - 0.5
|
||||
);
|
||||
x % 2 == 0 ? tU.x : tV.x,
|
||||
tU.y - 0.5,
|
||||
tV.y - 0.5
|
||||
);
|
||||
|
||||
return vec4(yuyv_to_rgb * yuv, 1.0);
|
||||
return vec4(yuyv_to_rgb_bt709 * yuv, 1.0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user