diff --git a/Makefile.common b/Makefile.common index f0131a50ec..f830f1e696 100644 --- a/Makefile.common +++ b/Makefile.common @@ -123,13 +123,13 @@ OBJ += frontend/frontend.o \ libretro-sdk/file/config_file.o \ libretro-sdk/file/config_file_userdata.o \ screenshot.o \ - gfx/scaler/scaler.o \ + libretro-sdk/gfx/scaler/scaler.o \ gfx/shader/shader_null.o \ gfx/shader/shader_context.o \ gfx/shader/shader_parse.o \ - gfx/scaler/pixconv.o \ - gfx/scaler/scaler_int.o \ - gfx/scaler/scaler_filter.o \ + libretro-sdk/gfx/scaler/pixconv.o \ + libretro-sdk/gfx/scaler/scaler_int.o \ + libretro-sdk/gfx/scaler/scaler_filter.o \ gfx/image/image_rpng.o \ gfx/fonts/fonts.o \ gfx/filter.o \ diff --git a/camera/video4linux2.c b/camera/video4linux2.c index 4ccb4e889f..6736939f6c 100644 --- a/camera/video4linux2.c +++ b/camera/video4linux2.c @@ -24,7 +24,7 @@ #include "../driver.h" #include "../performance.h" #include -#include "../gfx/scaler/scaler.h" +#include #include #include #include diff --git a/gfx/gl.c b/gfx/gl.c index e867d9223b..6be3c6a18d 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -21,7 +21,7 @@ #include "../driver.h" #include "../performance.h" -#include "scaler/scaler.h" +#include #include "image/image.h" #include diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 64b30d02db..5ebf59e34e 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -20,7 +20,7 @@ #include "fonts/fonts.h" #include "math/matrix.h" #include "gfx_context.h" -#include "scaler/scaler.h" +#include #include "fonts/gl_font.h" #include "shader/shader_context.h" diff --git a/gfx/omap_gfx.c b/gfx/omap_gfx.c index 01c9e0554a..d3b0e1d1e4 100644 --- a/gfx/omap_gfx.c +++ b/gfx/omap_gfx.c @@ -18,7 +18,7 @@ #include #include #include "../general.h" -#include "scaler/scaler.h" +#include #include "gfx_common.h" #include "gfx_context.h" #include "fonts/fonts.h" diff --git a/gfx/scaler/filter.h b/gfx/scaler/filter.h deleted file mode 100644 index d14cf1c2aa..0000000000 --- a/gfx/scaler/filter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - - -#ifndef FILTER_H__ -#define FILTER_H__ - -#include -#include "scaler.h" - -bool scaler_gen_filter(struct scaler_ctx *ctx); - -#endif - diff --git a/gfx/scaler/scaler_common.h b/gfx/scaler/scaler_common.h deleted file mode 100644 index 643a83748a..0000000000 --- a/gfx/scaler/scaler_common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2014 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef SCALER_COMMON_H__ -#define SCALER_COMMON_H__ - -#include - -static inline uint8_t clamp_8bit(int val) -{ - if (val > 255) - return 255; - if (val < 0) - return 0; - return (uint8_t)val; -} - -#endif diff --git a/gfx/scaler/scaler_int.h b/gfx/scaler/scaler_int.h deleted file mode 100644 index fd901bfce4..0000000000 --- a/gfx/scaler/scaler_int.h +++ /dev/null @@ -1,34 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef SCALER_INT_H__ -#define SCALER_INT_H__ - -#include "scaler.h" - -void scaler_argb8888_vert(const struct scaler_ctx *ctx, - void *output, int stride); - -void scaler_argb8888_horiz(const struct scaler_ctx *ctx, - const void *input, int stride); - -void scaler_argb8888_point_special(const struct scaler_ctx *ctx, - void *output, const void *input, - int out_width, int out_height, - int in_width, int in_height, - int out_stride, int in_stride); - -#endif - diff --git a/gfx/sdl2_gfx.c b/gfx/sdl2_gfx.c index 63d111b498..9d99e510a2 100644 --- a/gfx/sdl2_gfx.c +++ b/gfx/sdl2_gfx.c @@ -19,7 +19,7 @@ #include #include #include "../general.h" -#include "scaler/scaler.h" +#include #include "gfx_common.h" #include "gfx_context.h" #include "fonts/fonts.h" diff --git a/gfx/sdl_gfx.c b/gfx/sdl_gfx.c index a4e6a2160d..e23b0768e4 100644 --- a/gfx/sdl_gfx.c +++ b/gfx/sdl_gfx.c @@ -18,7 +18,7 @@ #include #include #include "../general.h" -#include "scaler/scaler.h" +#include #include "gfx_common.h" #include "gfx_context.h" #include "fonts/fonts.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index 1796e99e18..b2ab735e26 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -477,10 +477,10 @@ DRIVERS /*============================================================ SCALERS ============================================================ */ -#include "../gfx/scaler/scaler_filter.c" -#include "../gfx/scaler/pixconv.c" -#include "../gfx/scaler/scaler.c" -#include "../gfx/scaler/scaler_int.c" +#include "../libretro-sdk/gfx/scaler/scaler_filter.c" +#include "../libretro-sdk/gfx/scaler/pixconv.c" +#include "../libretro-sdk/gfx/scaler/scaler.c" +#include "../libretro-sdk/gfx/scaler/scaler_int.c" /*============================================================ FILTERS diff --git a/gfx/scaler/pixconv.c b/libretro-sdk/gfx/scaler/pixconv.c similarity index 95% rename from gfx/scaler/pixconv.c rename to libretro-sdk/gfx/scaler/pixconv.c index babb722e87..6181d3bcc9 100644 --- a/gfx/scaler/pixconv.c +++ b/libretro-sdk/gfx/scaler/pixconv.c @@ -1,19 +1,26 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (pixconv.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "pixconv.h" +#include #include #include #include diff --git a/gfx/scaler/scaler.c b/libretro-sdk/gfx/scaler/scaler.c similarity index 83% rename from gfx/scaler/scaler.c rename to libretro-sdk/gfx/scaler/scaler.c index 28a9d9a754..09fab7d649 100644 --- a/gfx/scaler/scaler.c +++ b/libretro-sdk/gfx/scaler/scaler.c @@ -1,22 +1,29 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "scaler.h" -#include "scaler_int.h" -#include "filter.h" -#include "pixconv.h" +#include +#include +#include +#include #include #include #include diff --git a/gfx/scaler/scaler_filter.c b/libretro-sdk/gfx/scaler/scaler_filter.c similarity index 83% rename from gfx/scaler/scaler_filter.c rename to libretro-sdk/gfx/scaler/scaler_filter.c index 6c5059f4eb..7547a00372 100644 --- a/gfx/scaler/scaler_filter.c +++ b/libretro-sdk/gfx/scaler/scaler_filter.c @@ -1,21 +1,27 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler_filter.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "filter.h" -#include "scaler_int.h" +#include +#include #include #include #include diff --git a/gfx/scaler/scaler_int.c b/libretro-sdk/gfx/scaler/scaler_int.c similarity index 85% rename from gfx/scaler/scaler_int.c rename to libretro-sdk/gfx/scaler/scaler_int.c index 7ab54e2010..12d38699c2 100644 --- a/gfx/scaler/scaler_int.c +++ b/libretro-sdk/gfx/scaler/scaler_int.c @@ -1,19 +1,26 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler_int.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "scaler_int.h" +#include #ifdef SCALER_NO_SIMD #undef __SSE2__ diff --git a/libretro-sdk/include/gfx/scaler/filter.h b/libretro-sdk/include/gfx/scaler/filter.h new file mode 100644 index 0000000000..d53e6f3214 --- /dev/null +++ b/libretro-sdk/include/gfx/scaler/filter.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2010-2014 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (filter.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_SCALER_FILTER_H__ +#define __LIBRETRO_SDK_SCALER_FILTER_H__ + +#include +#include + +bool scaler_gen_filter(struct scaler_ctx *ctx); + +#endif + diff --git a/gfx/scaler/pixconv.h b/libretro-sdk/include/gfx/scaler/pixconv.h similarity index 54% rename from gfx/scaler/pixconv.h rename to libretro-sdk/include/gfx/scaler/pixconv.h index 688f82de23..9078a92fb8 100644 --- a/gfx/scaler/pixconv.h +++ b/libretro-sdk/include/gfx/scaler/pixconv.h @@ -1,22 +1,29 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (pixconv.h). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef PIXCONV_H__ -#define PIXCONV_H__ +#ifndef __LIBRETRO_SDK_SCALER_PIXCONV_H__ +#define __LIBRETRO_SDK_SCALER_PIXCONV_H__ -#include "scaler_common.h" +#include void conv_0rgb1555_argb8888(void *output, const void *input, int width, int height, diff --git a/gfx/scaler/scaler.h b/libretro-sdk/include/gfx/scaler/scaler.h similarity index 55% rename from gfx/scaler/scaler.h rename to libretro-sdk/include/gfx/scaler/scaler.h index b975b43b51..ead54069e0 100644 --- a/gfx/scaler/scaler.h +++ b/libretro-sdk/include/gfx/scaler/scaler.h @@ -1,20 +1,27 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2014 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler.h). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef SCALER_H__ -#define SCALER_H__ +#ifndef __LIBRETRO_SDK_SCALER_H__ +#define __LIBRETRO_SDK_SCALER_H__ #include #include diff --git a/libretro-sdk/include/gfx/scaler/scaler_common.h b/libretro-sdk/include/gfx/scaler/scaler_common.h new file mode 100644 index 0000000000..d73555d6ec --- /dev/null +++ b/libretro-sdk/include/gfx/scaler/scaler_common.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2010-2014 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler_common.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_SCALER_COMMON_H__ +#define __LIBRETRO_SDK_SCALER_COMMON_H__ + +#include + +static inline uint8_t clamp_8bit(int val) +{ + if (val > 255) + return 255; + if (val < 0) + return 0; + return (uint8_t)val; +} + +#endif diff --git a/libretro-sdk/include/gfx/scaler/scaler_int.h b/libretro-sdk/include/gfx/scaler/scaler_int.h new file mode 100644 index 0000000000..10d8fc4191 --- /dev/null +++ b/libretro-sdk/include/gfx/scaler/scaler_int.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2010-2014 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (scaler_int.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_SCALER_INT_H__ +#define __LIBRETRO_SDK_SCALER_INT_H__ + +#include + +void scaler_argb8888_vert(const struct scaler_ctx *ctx, + void *output, int stride); + +void scaler_argb8888_horiz(const struct scaler_ctx *ctx, + const void *input, int stride); + +void scaler_argb8888_point_special(const struct scaler_ctx *ctx, + void *output, const void *input, + int out_width, int out_height, + int in_width, int in_height, + int out_stride, int in_stride); + +#endif + diff --git a/record/ffmpeg.c b/record/ffmpeg.c index 526925873a..f0099e0f41 100644 --- a/record/ffmpeg.c +++ b/record/ffmpeg.c @@ -46,7 +46,7 @@ extern "C" { #include "../fifo_buffer.h" #include #include "../general.h" -#include "../gfx/scaler/scaler.h" +#include #include #include "../audio/utils.h" #include "ffemu.h"