MCPcopy Create free account
hub / github.com/SatDump/SatDump / work

Method work

plugins/hinode_support/hinode/instruments/common.cpp:94–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 int HinodeDepacketizer::work(ccsds::CCSDSPacket &pkt, DecodedImage *result)
95 {
96 // if (pkt.payload.size() == pkt.header.packet_length + 1)
97 // return status;
98 result->apid = -1;
99
100 int wk = 0;
101 int rst2ndNo = 0;
102
103 if (status != BUFF_NOW)
104 { /* 1. waiting for start of next image */
105 if (pkt.header.sequence_flag == 0b01)
106 {
107 sci_hdr = parse_science_header(pkt);
108
109 if (sci_hdr.ImageCompMode != 0)
110 { // JPEG data
111 status = BUFF_NOW;
112 before_sq_count = pkt.header.packet_sequence_count;
113 before_sq_flag = pkt.header.sequence_flag;
114 }
115 else
116 { // not JPEG data
117 status = NOT_JPEG_DATA;
118 }
119 }
120
121 if (status == JPEG_INIT)
122 return JPEG_IRRETRIEVABLE; // KM note *12
123
124 return status;
125 }
126 else
127 { /* 2. Processing of image */
128
129 rst_tbl_t *rst_tbl = &rst_tbl_array[0];
130
131 if (pkt.header.sequence_flag == 0b01)
132 { /* 2.1. ���̓p�P�b�g����P�p�P�b�g�̏ꍇ */
133 /* finalize process of accumulated image */
134
135 int iret = 99; // invalid, determined soon
136
137 if (before_sq_flag == 0b01)
138 {
139 /* 2.1.1. Processing of designed pattern 8 */
140 iret = JPEG_IRRETRIEVABLE; // discard accumlated image
141 }
142 else
143 {
144 /* 2.1.2. Processing of designed pattern 4, 10 */
145 fill_tail(); // recover RSTn, EOI [KM51]
146 // Input: _sci_head.num_segment, Modified: num_RST, rst_tbl, buff_pos, buffer
147
148 if (num_RST != sci_hdr.num_segment - 1)
149 { // check number of RSTn
150 /* recovery failed, retry recovery */
151 wk = trunc_recovered(); // [KM52], KM note *9)

Callers 3

handleAPIDFunction · 0.45
processMethod · 0.45
processMethod · 0.45

Calls 1

decompress_jpeg12Function · 0.85

Tested by

no test coverage detected