How can we make the saveFrame() method in ExtractMpegFramesTest more efficient?

前端 未结 2 1853
轮回少年
轮回少年 2021-01-07 05:32

[edit] Reformatting into question and answer format following fadden@ suggestion.

In ExtractMpegFramesTest_egl14.java.txt, method saveFrame(), there is a loop for re

2条回答
  •  春和景丽
    2021-01-07 06:13

    [edit] Reformatting into question and answer format following fadden@ suggestion

    I wanted to suggest that this conversion can happen in the FragmentShader by changing the line

    gl_FragColor = texture2D(sTexture, vTextureCoord);
    

    into

    gl_FragColor = texture2D(sTexture, vTextureCoord).argb;
    

    which is an efficient shortcut to reorder in GPU the shader's output channels, that works in other ways too: .abgr or even .bggr etc.

提交回复
热议问题