summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Heron <phil@sanslogic.co.uk>2020-07-05 12:43:10 +0100
committerPhilip Heron <phil@sanslogic.co.uk>2020-07-05 12:43:10 +0100
commit2b79a2f65145222858f58de309fe768db861082a (patch)
tree5ca12eed13f312084c137fffaa0a6ac8623db715
parent035f920f5c96880bfd89d4469428b934e830c7c9 (diff)
Remove test on JPEG Component ID as they appear to be arbitrary
-rw-r--r--ssdv.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ssdv.c b/ssdv.c
index a9c9622..c05b4ec 100644
--- a/ssdv.c
+++ b/ssdv.c
@@ -768,16 +768,11 @@ static char ssdv_have_marker_data(ssdv_t *s)
for(i = 0; i < d[5]; i++)
{
uint8_t *dq = &d[i * 3 + 6];
- if(dq[0] != i + 1)
- {
- fprintf(stderr, "Error: Components are not in order in the SOF0 header\n");
- return(SSDV_ERROR);
- }
fprintf(stderr, "DQT table for component %i: %02X, Sampling factor: %ix%i\n", dq[0], dq[2], dq[1] & 0x0F, dq[1] >> 4);
/* The first (Y) component must have a factor of 2x2,2x1,1x2 or 1x1 */
- if(dq[0] == 1)
+ if(i == 0)
{
switch(dq[1])
{
@@ -790,7 +785,7 @@ static char ssdv_have_marker_data(ssdv_t *s)
return(SSDV_ERROR);
}
}
- else if(dq[0] != 1 && dq[1] != 0x11)
+ else if(i != 0 && dq[1] != 0x11)
{
fprintf(stderr, "Error: Component %i sampling factor must be 1x1\n", dq[0]);
return(SSDV_ERROR);
@@ -839,11 +834,6 @@ static char ssdv_have_marker_data(ssdv_t *s)
for(i = 0; i < d[0]; i++)
{
uint8_t *dh = &d[i * 2 + 1];
- if(dh[0] != i + 1)
- {
- fprintf(stderr, "Error: Components are not in order in the SOF0 header\n");
- return(SSDV_ERROR);
- }
fprintf(stderr, "Component %i DHT: %02X\n", dh[0], dh[1]);
}