From 83ce428d8bb5f4a762abf879adec076bc34cf36a Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 27 Jul 2022 11:00:45 -0400 Subject: full support for odd-dimension bitmaps and comps --- video.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'video.cpp') 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; } -- cgit v1.2.3