Skip to content

Pixel histogram from GPU decoding shows unnatural trend and abnormal spikes #736

@entron

Description

@entron

Hi TorchCodec team,

When using VideoDecoder(..., device="cuda") to decode a large sample of frames from various videos, I observed the following issues in the grayscale intensity histograms:

  1. The overall distribution is inconsistent with what’s expected from natural video content. The histogram lacks a smooth trend at the beginning and end.

  2. Certain grayscale values show abnormally high spikes that do not occur when decoding using FFmpeg or OpenCV.

Here is the histogram from 10,000 frames decoded via TorchCodec on GPU:

Image

If I set device to 'cpu' then the result looks more natural:

Image

My guess for GPU issues:

  1. TV ranges are mapped to PC range for some video but not for the others (e.g. when color_range=unknown)
  2. Probably related to 10 bit video decoding and how it is converted to 8 bit (see also: noise when decoding hevc yuv420p10le videos with device="cuda" #598 ). I do not see the high spikes for 8-bit videos.

Thanks for looking into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions