summaryrefslogtreecommitdiff
path: root/video.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-07-27 11:00:45 -0400
committerFox Caminiti <fox@foxcam.net>2022-07-27 11:00:45 -0400
commit83ce428d8bb5f4a762abf879adec076bc34cf36a (patch)
treec1500f027d9eec514ba1a2912e7a4763e7be26b2 /video.cpp
parentc6bd84c356b6aaa029b9708d7b99a4aba1673b6b (diff)
full support for odd-dimension bitmaps and comps
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/video.cpp b/video.cpp
index d39719e..bb3e17e 100644
--- a/video.cpp
+++ b/video.cpp
@@ -190,15 +190,10 @@ InitAV(char *filename, av_info *AV)
av_seek_frame(AV->FileFormatContext, -1, 0, AVSEEK_FLAG_BACKWARD);
};
-#if PACKEDRGB
internal void
-Store4x4Chunk(pixel_buffer *Raster);
+Convert4x4Chunk(pixel_buffer *Raster, uint8);
internal void
-SSE_ClearBuffer(pixel_buffer *Raster, uint16);
-#else
-internal void
-Libav_GBRAToRGBA(pixel_buffer *Raster);
-#endif
+ClearBuffer(pixel_buffer *Raster, void *);
internal int16
LoadVideoFrame(video_source *Source, memory *Memory, int32 TimelineFrame)
@@ -261,11 +256,7 @@ LoadVideoFrame(video_source *Source, memory *Memory, int32 TimelineFrame)
// NOTE(fox): This function will be replaced in the future.
AV->RGBContext = sws_getContext(AV->VideoFrame->width, AV->VideoFrame->height, (AVPixelFormat)AV->VideoFrame->format,
-#if PACKEDRGB
AV->VideoFrame->width, AV->VideoFrame->height, AV_PIX_FMT_RGBA, SWS_BILINEAR,
-#else
- AV->VideoFrame->width, AV->VideoFrame->height, AV_PIX_FMT_GBRAP, SWS_BILINEAR,
-#endif
NULL, NULL, NULL);
if(!AV->RGBContext) {
@@ -277,13 +268,9 @@ LoadVideoFrame(video_source *Source, memory *Memory, int32 TimelineFrame)
av_frame_unref(AV->VideoFrame);
-#if PACKEDRGB
- Store4x4Chunk(Buffer);
- SSE_CopyToBuffer(Buffer, 1);
- SSE_ClearBuffer(Buffer, 1);
-#else
- Libav_GBRAToRGBA(Buffer);
-#endif
+ Convert4x4Chunk(Buffer, 0);
+ CopyToBuffer(Buffer, 1);
+ ClearBuffer(Buffer, Buffer->EffectBuffer);
return 0;
}