Repository: godotengine/godot (language: cpp)

Issue:
Gray line at the bottom of scaled VideoStreamPlayer
### Tested versions

Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org



### System information

Linux; Vulkan API 1.3.255 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon RX 5600 XT (RADV NAVI10)  

### Issue description

When have a VideoStreamPlayer that's scaled down (in my case, to 50%), when the video plays, it shows a gray line at the bottom.  The gray line is not visible when I play the video at 1:1 scale.

I don't think this is the same as #62752 -- first, I think my video doesn't have any overscan since its resolution is a multiple of 16, and second, it doesn't manifest as duplication but as a grey line.

![gray-line](https://github.com/godotengine/godot/assets/77003/13a89274-61ea-4d83-a44f-52dc807e4e7f)

Weirdly, it seems to depend on some tiny details of the video file.  I have one video file which experiences it, and one that doesn't even though both are the same resolution, frame rate, etc.  The one with the line is made by:
`ffmpeg -r 30  -pattern_type sequence -i out/cat-%06d.png    -map 0:v  -y  cat.ogv`
The one without is made by:
`theora_png2theora -k 30 -f 30 out/cat-%06d.png -o cat2.ogv`

Unfortunately, as you can see, the second one produces a video with the wrong color (and I have to run it through ffmpeg anyway to get the audio added; to save you from having to hear my awful voice acting looping over and over, I didn't add the audio to either of the clips in the repro project).  

### Steps to reproduce

The attached sample code reproduces this issue.  I have a VideoStreamPlayer which is scaled (in this case, the root node is scaled, because that pretty closely matches my actual project).   There are actually two players, to demonstrate that the effect depends on some weird detail of the actual video; the one on the left is the one with the problem (the color mismatch on the right is Theora's fault not Godot's).

### Minimal reproduction project (MRP)

[white-line.zip](https://github.com/godotengine/godot/files/14086142/white-line.zip)



Discussion / hints:
I've fixed #62752 and this still happens so I don't think they're related at all.
It only happens when texture filter is set to linear. Setting the filter to nearest removes the gray line.

It's weird that it happens only in one of the videos but the background color is different so that might be the reason.
Video on the left with the gray line:

```
❯ ffprobe cat.ogv                                                                                  
Input #0, ogg, from 'cat.ogv':
  Duration: 00:00:05.73, start: 0.000000, bitrate: 216 kb/s
  Stream #0:0: Video: theora, yuv444p, 256x256 [SAR 1:1 DAR 1:1], 30 tbr, 30 tbn
      Metadata:
        encoder         : Lavc60.31.102 libtheora
```

Video on the right (which renders correctly in Godot):

```
❯ ffprobe cat2.ogv
[ogg @ 0x559083ead180] Broken file, keyframe not correctly marked.
Input #0, ogg, from 'cat2.ogv':
  Duration: 00:00:05.77, start: 0.000000, bitrate: 65 kb/s
  Stream #0:0: Video: theora, yuv420p, 256x256, 30 tbr, 30 tbn
```

Fix patch:
diff --git a/thirdparty/misc/yuv2rgb.h b/thirdparty/misc/yuv2rgb.h
index d8f7fd6de2d0..e8ccd427d027 100644
--- a/thirdparty/misc/yuv2rgb.h
+++ b/thirdparty/misc/yuv2rgb.h
@@ -30,6 +30,7 @@ ship it.
  * 2. At some point or another the code relied on the byte order of a uint32_t, this has been fixed
  * 3. Output has been reordered to struct { uint8_t r, g, b, a; } precisely in accordance with the function names
  * 4. Removing unused 'dither' parameter
+ * 5. Fix last line not being converted (and therefore was transparent)
  */
 
 #ifndef YUV2RGB_H
@@ -848,7 +849,6 @@ static void yuv422_2_rgb8888(uint8_t  *dst_ptr,
 		      int32_t   uv_span,
 		      int32_t   dst_span)
 {
-    height -= 1;
     while (height > 0)
     {
 	height -= width<<16;
@@ -1020,7 +1020,6 @@ static void yuv444_2_rgb8888(uint8_t  *dst_ptr,
 		      int32_t   uv_span,
 		      int32_t   dst_span)
 {
-    height -= 1;
     while (height > 0)
     {
 	height -= width<<16;


Test patch: