GLSL_QCOM_image_processing2

The original text file describing this extension as a set of diffs to the OpenGL Shading Language Specification follows.

Name

    QCOM_image_processing2

Name Strings

    GL_QCOM_image_processing2

Contact

    Wooyoung Kim, Qualcomm Technologies Inc.  (wooykim 'at' qti.qualcomm.com)

Contributors

    Wooyoung Kim, Qualcomm Technologies Inc.
    Jeff Leger,   Qualcomm Technologies Inc.
    Ruihao Zhang, Qualcomm Technologies Inc.

Status

    Final

Version

    Last Modified Date: 26-Jul-2024
    Revision: 1

Number

    TBD.

Dependencies

    This extension can be applied to OpenGL GLSL versions 1.40
    (#version 140) and higher.

    This extension can be applied to OpenGL ES ESSL versions 3.10
    (#version 310) and higher.

    Requires GL_KHR_vulkan_glsl.

    Requires GL_QCOM_image_processing.


Overview

    This extension is a follow-on to an earlier extension GL_QCOM_image_processing which has
    added four new shader instructions to perform some of the frequently sought image
    processing tasks. This extension adds another four new image processing operations.

    Block Matching Window SSD: The operation repeatedly performs block match operations
      across a 2D window specified on the sampler used to create the target image to
      compute an error at each (X,Y) within the 2D window that describes whether the texel
      in the target image matches the corresponding texel in the reference image and
      return either the minimum or maximum error using sum of squares (SSD) of the differences.

    Block Matching Window SAD: This operation follows the same pattern as "Block Matching
      Window SSD", computing the sum of the absolute differences (SAD)

    Block Matching Gather SSD: The operation computes errors at 4 texels at the given offsets
      that describe whether the texels in the target image match the corresponding texels in
      the reference image. It returns the SSD error metrics at the 4 texel offsets in the X, Y,
      Z, and W components.

    Block Matching Gather SAD: This operation follows the same pattern as "Block Matching
     Gather SSD", computing the sum of the absolute differences at 4 offsets.

    Each of the above 4 image processing operations are limited to single-component formats.


Modifications to the OpenGL GL Shading Language Specification, Version 1.40, dated 22 November 2009

    Including the following line in a shader can be used to control the
    language features described in this extension:

        #extension GL_QCOM_image_processing2  : 

    where  is as specified in Section 3.3.

    A new preprocessor #define is added to the OpenGL Shading Language:

        #define GL_QCOM_image_processing2    1

    Add to the table in Subsection 8.7 "Texel Lookup Functions"
    the following image processing functions as well as the notes below the table.

    -----------------------------------------------------------------------------------+
    | Syntax                               | Description                                 |
    -----------------------------------------------------------------------------------+
    | vec4 textureBlockMatchWindowSSDQCOM( | Windowed block matching operation that      |
    |       sampler2D target,              | measures the correlation (or similarity)    |
    |       uvec2     targetCoord,         | of the target block and reference block.    |
    |       sampler2D reference,           | targetCoord and refCoord specify the texture|
    |       uvec2     refCoord,            | coordinates (in texels) of the bottom left  |
    |       uvec2     blockSize)           | corners of the blocks in target and refere- |
    |                                      | nce images. The error metric is the sum of  |
    |                                      | the squares of the values (SSD).            |
    -----------------------------------------------------------------------------------+
    | vec4 textureBlockMatchWindowSADQCOM( | Windowed block matching operation that      |
    |       sampler2D target,              | measures the correlation (or similarity)    |
    |       uvec2     targetCoord,         | of the target block and reference block.    |
    |       sampler2D reference,           | targetCoord and refCoord specify the texture|
    |       uvec2     refCoord,            | coordinates (in texels) of the bottom left  |
    |       uvec2     blockSize)           | corners of the blocks in target and refere- |
    |                                      | nce images. The error metric is the sum of  |
    |                                      | the absolute values (SAD).                  |
    -----------------------------------------------------------------------------------+
    | vec4 textureBlockMatchGatherSSDQCOM( | Gathered block matching operation that      |
    |       sampler2D target,              | measures the correlation (or similarity)    |
    |       uvec2     targetCoord,         | of the target block and reference block.    |
    |       sampler2D reference,           | targetCoord and refCoord specify the texture|
    |       uvec2     refCoord,            | coordinates (in texels) of the bottom left  |
    |       uvec2     blockSize)           | corners of the blocks in target and refere- |
    |                                      | nce images. The error metric is the sum of  |
    |                                      | the squares of the values (SSD).            |
    -----------------------------------------------------------------------------------+
    | vec4 textureBlockMatchGatherSADQCOM( | Gathered block matching operation that      |
    |       sampler2D target,              | measures the correlation (or similarity)    |
    |       uvec2     targetCoord,         | of the target block and reference block.    |
    |       sampler2D reference,           | targetCoord and refCoord specify the texture|
    |       uvec2     refCoord,            | coordinates (in texels) of the bottom left  |
    |       uvec2     blockSize)           | corners of the blocks in target and refere- |
    |                                      | nce images. The error metric is the sum of  |
    |                                      | the absolute values (SAD).                  |
    -----------------------------------------------------------------------------------+


    *  and  specify the two input textures. When the block
      from one texture is used repeatedly across multiple instructions, specifying
      that texture as the reference texture would yield better performance.

    * blockSize specifies the size (in texels) of the blocks to be compared.


Restrictions:

    It is a compile-time error if a sampler variable used as the  or 
    parameter in functions textureBlockMatchWindowSADQCOM, textureBlockMatchWindowSSDQCOM,
    textureBlockMatchGatherSADQCOM, and/or textureBlockMatchGatherSSDQCOM is used in
    any other context in the shader.

Issues


Revision History

    Rev.  Date           Author    Changes
    ----  -----------    --------  --------------------------------------------
    1     26-Jul-2024    wooykim   Initial version