Skip to content

Commit

Permalink
Correct texture format size for NV12
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Feb 1, 2024
1 parent 7bc8a32 commit d793d0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ const fn texture_format_size(texture_format: wgpu::TextureFormat) -> f32 {
Astc { block: B12x12, channel: _ } => 9.0, // 12.0 * 12.0 / 16.0

// 8-bit two-plane 4:2:0 YUV
NV12 => 3.0, // (8.0 + 16.0) / 8.0
// The first plane consists of 8-bit G components.
// The second plane consists of 16-bit BR components.
// The resolution of the second plane is halved both vertically and horizontally.
NV12 => 1.5, // (8.0 + 16.0 / 2.0 / 2.0) / 8.0
}
}

0 comments on commit d793d0c

Please sign in to comment.