mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 01:52:46 +08:00
[jpegd]: remove tailing 0xff patch from parser
Tailing 0xff will always be done in hal thread. There is not need to doing this twice. Change-Id: Ide4fcc4a2e252be04067c6990fc6a8e9ba8ee824 Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:

committed by
Herman Chen

parent
ba6c612544
commit
4ef69884a6
@@ -960,28 +960,6 @@ jpegd_split_frame(RK_U8 *src, RK_U32 src_size,
|
||||
*dst_size = src_size;
|
||||
}
|
||||
|
||||
/* NOTE: hardware bug, need to remove tailing FF 00 before FF D9 end flag */
|
||||
if (end[-1] == 0xD9 && end[-2] == 0xFF) {
|
||||
end -= 2;
|
||||
|
||||
do {
|
||||
if (end[-1] == 0xFF) {
|
||||
end--;
|
||||
continue;
|
||||
}
|
||||
if (end[-1] == 0x00 && end [-2] == 0xFF) {
|
||||
jpegd_dbg_parser("remove tailing FF 00 before FF D9 end flag.");
|
||||
end -= 2;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
|
||||
end[0] = 0xff;
|
||||
end[1] = 0xD9;
|
||||
}
|
||||
|
||||
jpegd_dbg_func("exit\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -1000,27 +978,6 @@ jpegd_handle_stream(RK_U8 *src, RK_U32 src_size,
|
||||
*dst_size = 0; /* no need to copy */
|
||||
end = src + src_size;
|
||||
|
||||
/* NOTE: hardware bug, need to remove tailing FF 00 before FF D9 end flag */
|
||||
if (end[-1] == 0xD9 && end[-2] == 0xFF) {
|
||||
end -= 2;
|
||||
|
||||
do {
|
||||
if (end[-1] == 0xFF) {
|
||||
end--;
|
||||
continue;
|
||||
}
|
||||
if (end[-1] == 0x00 && end [-2] == 0xFF) {
|
||||
jpegd_dbg_parser("remove tailing FF 00 before FF D9 end flag.");
|
||||
end -= 2;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
end[0] = 0xff;
|
||||
end[1] = 0xD9;
|
||||
}
|
||||
|
||||
jpegd_dbg_func("exit\n");
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user