## 2 Related Work
### JPEG-1 Image File Structure  
The JPEG-1 standard defines a file format to store all the information necessary to decode a codestream. The JPEG-1 file is structured using marker segments, as listed in Table 2. All the parameters that are necessary for decoding are stored in specific markers. A specified marker ID indicates the beginning of each marker segment bitstream. Any number of markers may appear in any order in the JPEG-1 file. Each marker begins with 0 xFF, followed by a byte, which indicates a marker type [29]. In the segment, two little endianness formatted bytes follow the marker's ID bytes, which are the length of the segment. Generally, any type of user data can be embedded in the segment up to 64 K bytes using JPEG-1 markers. Each segment has its own format and structure. Since this paper focuses on the application-specific metadata for converting legacy 360-degree images to JPEG 360 images, not on encoding and decoding related metadata, the related metadata markers are introduced. The JPEG standard specifies the start of the frame (SOF) and defines the Huffman table (DHT), quantization table (DQT), and restart (RSTn) markers for metadata required \begin{table}
\begin{tabular}{c c c} \hline \hline
**Short Name** & **ID Bytes** & **Name and Comments** \\ \hline SOI & 0 xFD8 & Start of the image \\ \hline SOF0 & 0 xFC0 & Start of the Frame Baseline DCT. Width, height, the number of the components, and component’s subsampling are specified in this segment \\ \hline SOF2 & 0 xFC2 & Start of the Frame Progressive DCT. Width, height, the number of the components, and component’s subsampling are specified in this segment \\ \hline DHT & 0 xFC4 & Define Huffman Table(s) \\ \hline DQT & 0 xFDB & Define Quantization Table(s) \\ \hline DRI & 0 xFDD & Define Restart Interval. Specifies the interval between RSTn markers \\ \hline SOS & 0 xFDA & Start of the scan. Top to bottom scan of the image \\ \hline RSTn & 0 xFPDn (n = 0-7) & Restart \\ \hline APPn & 0 xFEn & Application-specific. Like EXIF/JFIF \\ \hline COM & 0 xFFE & Comment \\ \hline EOI & 0 xFD9 & End of the image \\ \hline \hline \end{tabular}
\end{table} 
Table 2: List of common jpeg markers. for decoding the image codestream. It also specifies application (APPn) markers for application-specific uses beyond the JPEG standard's metadata. The APP0 marker segment is specified for the JFIF (ISO/IEC 10918-5) format. JFIF is used for the file-based interchange of images encoded according to the JPEG-1 image coding standard [30]. It is mandatory that the JFIF APP0 marker segment follows the start of the image (SOI) marker. APP1 is also recorded after the SOI marker. If APP1 and APP0 marker segments are both present, then APP1 follows APP0. The APP1 may hold the exchangeable image file format (EXIF) or extendable metadata-platform (XMP)-formatted metadata. It can be identified by the signature string present after the length bytes. EXIF is a standard developed by the Japan Electronics and Information Technology Industries Association. The APP1 EXIF marker contains a length value and the identifying signature string. The identifying signature string for the APP1 EXIF marker is 'Exif\(\backslash\)0\(\backslash\)0' (0x457896600000). The metadata attribute information in EXIF is stored in a tagged image file format (TIFF) structure [31]. TIFF structure consists of a TIFF header and a maximum of two image file directories (0 th IFD and 1 st IFD). Compressed primary-image-related information is stored in the 0 th IFD. The first IFD may be used for thumbnail images. The IFD header has information about byte order endianness of TIFF bytes and offset values for the first IFD. The IFD structure follows the format consisting of 2 bytes for the number of fields count, the next number of fields count times 12 bytes for the field arrays, and 4 bytes for the next IFD offset value. Each of the 12 bytes fields consists of 2 bytes for a unique tag, 2 bytes for the type, 4 bytes for the count, and 4 bytes for the offset value of the tag [32].