mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
Don't need rjpeg__jpeg_test
This commit is contained in:
parent
a5cf78fd68
commit
9202256c3c
@ -173,16 +173,6 @@ static void rjpeg__start_mem(rjpeg__context *s, const uint8_t *buffer, int len)
|
|||||||
s->img_buffer_end = (uint8_t *) buffer+len;
|
s->img_buffer_end = (uint8_t *) buffer+len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rjpeg__rewind(rjpeg__context *s)
|
|
||||||
{
|
|
||||||
/* conceptually rewind SHOULD rewind to the beginning of the stream,
|
|
||||||
* but we just rewind to the beginning of the initial buffer, because
|
|
||||||
* we only use it after doing 'test', which only ever looks at at most 92 bytes
|
|
||||||
*/
|
|
||||||
s->img_buffer = s->img_buffer_original;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int rjpeg__jpeg_test(rjpeg__context *s);
|
|
||||||
static uint8_t *rjpeg__jpeg_load(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp);
|
static uint8_t *rjpeg__jpeg_load(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp);
|
||||||
|
|
||||||
/* this is not threadsafe */
|
/* this is not threadsafe */
|
||||||
@ -209,10 +199,7 @@ static int rjpeg__vertically_flip_on_load = 0;
|
|||||||
|
|
||||||
static unsigned char *rjpeg__load_main(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp)
|
static unsigned char *rjpeg__load_main(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp)
|
||||||
{
|
{
|
||||||
if (rjpeg__jpeg_test(s))
|
return rjpeg__jpeg_load(s,x,y,comp,req_comp);
|
||||||
return rjpeg__jpeg_load(s,x,y,comp,req_comp);
|
|
||||||
|
|
||||||
return rjpeg__errpuc("unknown image type", "Image not of any known type, or corrupt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned char *rjpeg__load_flip(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp)
|
static unsigned char *rjpeg__load_flip(rjpeg__context *s, unsigned *x, unsigned *y, int *comp, int req_comp)
|
||||||
@ -2419,17 +2406,6 @@ static unsigned char *rjpeg__jpeg_load(rjpeg__context *s, unsigned *x, unsigned
|
|||||||
return rjpeg_load_jpeg_image(&j, x,y,comp,req_comp);
|
return rjpeg_load_jpeg_image(&j, x,y,comp,req_comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rjpeg__jpeg_test(rjpeg__context *s)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
rjpeg__jpeg j;
|
|
||||||
j.s = s;
|
|
||||||
rjpeg__setup_jpeg(&j);
|
|
||||||
r = rjpeg__decode_jpeg_header(&j, RJPEG_SCAN_TYPE);
|
|
||||||
rjpeg__rewind(s);
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
static INLINE void video_frame_convert_rgba_to_bgra(
|
static INLINE void video_frame_convert_rgba_to_bgra(
|
||||||
const void *src_data,
|
const void *src_data,
|
||||||
void *dst_data,
|
void *dst_data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user