class ov::op::util::ConvertColorNV12Base


Base class for color conversion operation from NV12 to RGB/BGR format. Input : More…

#include <convert_color_nv12_base.hpp>

class ConvertColorNV12Base: public ov::op::Op
    // enums

    enum ColorConversion;

    // methods

    "ConvertColorNV12Base""util" OPENVINO_OP(, );
    virtual void validate_and_infer_types();
    virtual boolAttributeVisitor& visit_attributes();

// direct descendants

class NV12toBGR;
class NV12toRGB;

Inherited Members

    // typedefs

    typedef DiscreteTypeInfo type_info_t;
    typedef std::map<std::string, Any> RTMap;

    // methods

    virtual void validate_and_infer_types();
    void constructor_validate_and_infer_types();
    virtual boolAttributeVisitor& visit_attributes();
    virtual const ov::op::AutoBroadcastSpec& get_autob() const;
    virtual bool has_evaluate() const;
    virtual boolconst ov::HostTensorVector&const ov::HostTensorVector& evaluate(, ) const;

    virtual boolconst ov::HostTensorVector&const ov::HostTensorVector&const EvaluationContext& evaluate(

        ) const;

    virtual boolov::TensorVector&const ov::TensorVector& evaluate(, ) const;

    virtual boolov::TensorVector&const ov::TensorVector&const ov::EvaluationContext& evaluate(

        ) const;

    virtual boolov::TensorVector& evaluate_lower() const;
    virtual boolov::TensorVector& evaluate_upper() const;
    virtual boolTensorLabelVector& evaluate_label() const;
    virtual boolOutputVector&const OutputVector& constant_fold(, );
    virtual OutputVector decompose_op() const;
    virtual const type_info_t& get_type_info() const = 0;
    const char \* get_type_name() const;
    voidconst NodeVector& set_arguments();
    voidconst OutputVector& set_arguments();
    voidsize_tconst Output<Node>& set_argument(, );
    voidsize_tconst element::Type&const PartialShape& set_output_type(, , );
    voidsize_t set_output_size();
    void invalidate_values();
    virtual void revalidate_and_infer_types();
    virtual std::string description() const;
    const std::string& get_name() const;
    voidconst std::string& set_friendly_name();
    const std::string& get_friendly_name() const;
    virtual bool is_dynamic() const;
    size_t get_instance_id() const;
    virtual std::ostream&std::ostream&uint32_t write_description(, ) const;
    const std::vector<std::shared_ptr<Node>>& get_control_dependencies() const;
    const std::vector<Node \*>& get_control_dependents() const;
    voidstd::shared_ptr<Node> add_control_dependency();
    voidstd::shared_ptr<Node> remove_control_dependency();
    void clear_control_dependencies();
    void clear_control_dependents();
    voidconst std::shared_ptr<const Node>& add_node_control_dependencies();
    voidconst std::shared_ptr<const Node>& add_node_control_dependents();
    voidstd::shared_ptr<Node> transfer_control_dependents();
    size_t get_output_size() const;
    const element::Type&size_t get_output_element_type() const;
    const element::Type& get_element_type() const;
    const Shape&size_t get_output_shape() const;
    const PartialShape&size_t get_output_partial_shape() const;
    Output<const Node> get_default_output() const;
    Output<Node> get_default_output();
    virtual size_t get_default_output_index() const;
    size_t no_default_index() const;
    const Shape& get_shape() const;
    descriptor::Tensor&size_t get_output_tensor() const;
    descriptor::Tensor&size_t get_input_tensor() const;
    std::set<Input<Node>>size_t get_output_target_inputs() const;
    size_t get_input_size() const;
    const element::Type&size_t get_input_element_type() const;
    const Shape&size_t get_input_shape() const;
    const PartialShape&size_t get_input_partial_shape() const;
    Node \*size_t get_input_node_ptr() const;
    std::shared_ptr<Node>size_t get_input_node_shared_ptr() const;
    Output<Node>size_t get_input_source_output() const;
    virtual std::shared_ptr<Node>const OutputVector& clone_with_new_inputs() const = 0;
    std::shared_ptr<Node>const OutputVector& copy_with_new_inputs() const;

    std::shared_ptr<Node>const OutputVector&const std::vector<std::shared_ptr<Node>>& copy_with_new_inputs(

        ) const;

    boolstd::shared_ptr<const Node> has_same_type() const;
    RTMap& get_rt_info();
    const RTMap& get_rt_info() const;
    NodeVectorbool get_users() const;
    boolconst Node& operator < () const;
    std::vector<Input<Node>> inputs();
    std::vector<Input<const Node>> inputs() const;
    std::vector<Output<Node>> input_values() const;
    std::vector<Output<Node>> outputs();
    std::vector<Output<const Node>> outputs() const;
    Input<Node>size_t input();
    Input<const Node>size_t input() const;
    Output<Node>size_t input_value() const;
    Output<Node>size_t output();
    Output<const Node>size_t output() const;

    virtual boolov::pass::pattern::Matcher \*const Output<Node>&const Output<Node>& match_value(


    virtual boolov::pass::pattern::Matcher \*const Output<Node>& match_node(, );
    static _OPENVINO_HIDDEN_METHODconst ::ov::Node::type_info_t& get_type_info_static();
    virtual const ::ov::Node::type_info_t& get_type_info() const;

Detailed Documentation

Base class for color conversion operation from NV12 to RGB/BGR format. Input :

  • Operation expects input shape in NHWC layout.

  • Input NV12 image can be represented in a two ways: a) Single plane: NV12 height dimension is 1.5x bigger than image height. ‘C’ dimension shall be 1 b) Two separate planes: Y and UV. In this case b1) Y plane has height same as image height. ‘C’ dimension equals to 1 b2) UV plane has dimensions: ‘H’ = image_h / 2; ‘W’ = image_w / 2; ‘C’ = 2.

  • Supported element types: u8 or any supported floating-point type. Output :

  • Output node will have NHWC layout and shape HxW same as image spatial dimensions.

  • Number of output channels ‘C’ will be 3

    Conversion of each pixel from NV12 (YUV) to RGB space is represented by following formulas: R = 1.164 * (Y - 16) + 1.596 * (V - 128) G = 1.164 * (Y - 16) - 0.813 * (V - 128) - 0.391 * (U - 128) B = 1.164 * (Y - 16) + 2.018 * (U - 128) Then R, G, B values are clipped to range (0, 255)


virtual void validate_and_infer_types()

Verifies that attributes and inputs are consistent and computes output shapes and element types. Must be implemented by concrete child classes so that it can be run any number of times.

Throws if the node is invalid.