FFmpeg
mxpegdec.c
Go to the documentation of this file.
1 /*
2  * MxPEG decoder
3  * Copyright (c) 2011 Anatoly Nenashev
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 
23 /**
24  * @file
25  * MxPEG decoder
26  */
27 
28 #include "libavutil/mem.h"
29 #include "codec_internal.h"
30 #include "decode.h"
31 #include "mjpeg.h"
32 #include "mjpegdec.h"
33 
34 typedef struct MXpegDecodeContext {
36  AVFrame *picture[2]; /* pictures array */
37  int picture_index; /* index of current picture */
38  int got_sof_data; /* true if SOF data successfully parsed */
39  int got_mxm_bitmask; /* true if MXM bitmask available */
40  uint8_t *mxm_bitmask; /* bitmask buffer */
41  unsigned bitmask_size; /* size of bitmask */
42  int has_complete_frame; /* true if has complete frame */
43  uint8_t *completion_bitmask; /* completion bitmask of macroblocks */
44  unsigned mb_width, mb_height; /* size of picture in MB's from MXM header */
46 
48 {
49  MXpegDecodeContext *s = avctx->priv_data;
50  MJpegDecodeContext *jpg = &s->jpg;
51  int i;
52 
53  jpg->picture_ptr = NULL;
54  ff_mjpeg_decode_end(avctx);
55 
56  for (i = 0; i < 2; ++i)
57  av_frame_free(&s->picture[i]);
58 
59  s->bitmask_size = 0;
60  av_freep(&s->mxm_bitmask);
61  av_freep(&s->completion_bitmask);
62 
63  return 0;
64 }
65 
67 {
68  MXpegDecodeContext *s = avctx->priv_data;
69 
70  s->picture[0] = av_frame_alloc();
71  s->picture[1] = av_frame_alloc();
72  if (!s->picture[0] || !s->picture[1])
73  return AVERROR(ENOMEM);
74 
75  s->jpg.picture_ptr = s->picture[0];
76  return ff_mjpeg_decode_init(avctx);
77 }
78 
80  const uint8_t *buf_ptr, int buf_size)
81 {
82  int len;
83  if (buf_size < 2)
84  return 0;
85  len = AV_RB16(buf_ptr);
86  skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
87 
88  return 0;
89 }
90 
92  const uint8_t *buf_ptr, int buf_size)
93 {
94  unsigned bitmask_size, mb_count;
95  int i;
96 
97  s->mb_width = AV_RL16(buf_ptr+4);
98  s->mb_height = AV_RL16(buf_ptr+6);
99  mb_count = s->mb_width * s->mb_height;
100 
101  bitmask_size = (mb_count + 7) >> 3;
102  if (bitmask_size > buf_size - 12) {
103  av_log(s->jpg.avctx, AV_LOG_ERROR,
104  "MXM bitmask is not complete\n");
105  return AVERROR(EINVAL);
106  }
107 
108  if (s->bitmask_size != bitmask_size) {
109  s->bitmask_size = 0;
110  av_freep(&s->mxm_bitmask);
111  s->mxm_bitmask = av_malloc(bitmask_size);
112  if (!s->mxm_bitmask) {
113  av_log(s->jpg.avctx, AV_LOG_ERROR,
114  "MXM bitmask memory allocation error\n");
115  return AVERROR(ENOMEM);
116  }
117 
118  av_freep(&s->completion_bitmask);
119  s->completion_bitmask = av_mallocz(bitmask_size);
120  if (!s->completion_bitmask) {
121  av_log(s->jpg.avctx, AV_LOG_ERROR,
122  "Completion bitmask memory allocation error\n");
123  return AVERROR(ENOMEM);
124  }
125 
126  s->bitmask_size = bitmask_size;
127  }
128 
129  memcpy(s->mxm_bitmask, buf_ptr + 12, bitmask_size);
130  s->got_mxm_bitmask = 1;
131 
132  if (!s->has_complete_frame) {
133  uint8_t completion_check = 0xFF;
134  for (i = 0; i < bitmask_size; ++i) {
135  s->completion_bitmask[i] |= s->mxm_bitmask[i];
136  completion_check &= s->completion_bitmask[i];
137  }
138  s->has_complete_frame = !(completion_check ^ 0xFF);
139  }
140 
141  return 0;
142 }
143 
145  const uint8_t *buf_ptr, int buf_size)
146 {
147  int len, ret = 0;
148  if (buf_size < 2)
149  return 0;
150  len = AV_RB16(buf_ptr);
151  if (len > 14 && len <= buf_size && !strncmp(buf_ptr + 2, "MXM", 3)) {
152  ret = mxpeg_decode_mxm(s, buf_ptr + 2, len - 2);
153  }
154  skip_bits(&s->jpg.gb, 8*FFMIN(len,buf_size));
155 
156  return ret;
157 }
158 
160  AVFrame *reference_ptr)
161 {
162  if ((jpg->width + 0x0F)>>4 != s->mb_width ||
163  (jpg->height + 0x0F)>>4 != s->mb_height) {
164  av_log(jpg->avctx, AV_LOG_ERROR,
165  "Picture dimensions stored in SOF and MXM mismatch\n");
166  return AVERROR(EINVAL);
167  }
168 
169  if (reference_ptr->data[0]) {
170  int i;
171  for (i = 0; i < MAX_COMPONENTS; ++i) {
172  if ( (!reference_ptr->data[i] ^ !jpg->picture_ptr->data[i]) ||
173  reference_ptr->linesize[i] != jpg->picture_ptr->linesize[i]) {
174  av_log(jpg->avctx, AV_LOG_ERROR,
175  "Dimensions of current and reference picture mismatch\n");
176  return AVERROR(EINVAL);
177  }
178  }
179  }
180 
181  return 0;
182 }
183 
184 static int mxpeg_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
185  int *got_frame, AVPacket *avpkt)
186 {
187  const uint8_t *buf = avpkt->data;
188  int buf_size = avpkt->size;
189  MXpegDecodeContext *s = avctx->priv_data;
190  MJpegDecodeContext *jpg = &s->jpg;
191  const uint8_t *buf_end, *buf_ptr;
192  const uint8_t *unescaped_buf_ptr;
193  int unescaped_buf_size;
194  int start_code;
195  int ret;
196 
197  if (avctx->skip_frame == AVDISCARD_ALL)
198  return AVERROR_PATCHWELCOME;
199 
200  buf_ptr = buf;
201  buf_end = buf + buf_size;
202  jpg->got_picture = 0;
203  s->got_mxm_bitmask = 0;
204  s->got_sof_data = !!s->got_sof_data;
205  while (buf_ptr < buf_end) {
206  start_code = ff_mjpeg_find_marker(jpg, &buf_ptr, buf_end,
207  &unescaped_buf_ptr, &unescaped_buf_size);
208  if (start_code < 0)
209  goto the_end;
210  {
211  init_get_bits(&jpg->gb, unescaped_buf_ptr, unescaped_buf_size*8);
212 
213  if (start_code >= APP0 && start_code <= APP15) {
214  mxpeg_decode_app(s, unescaped_buf_ptr, unescaped_buf_size);
215  }
216 
217  switch (start_code) {
218  case SOI:
219  if (jpg->got_picture) //emulating EOI
220  goto the_end;
221  break;
222  case EOI:
223  goto the_end;
224  case DQT:
225  ret = ff_mjpeg_decode_dqt(jpg);
226  if (ret < 0) {
227  av_log(avctx, AV_LOG_ERROR,
228  "quantization table decode error\n");
229  return ret;
230  }
231  break;
232  case DHT:
233  ret = ff_mjpeg_decode_dht(jpg);
234  if (ret < 0) {
235  av_log(avctx, AV_LOG_ERROR,
236  "huffman table decode error\n");
237  return ret;
238  }
239  break;
240  case COM:
241  ret = mxpeg_decode_com(s, unescaped_buf_ptr,
242  unescaped_buf_size);
243  if (ret < 0)
244  return ret;
245  break;
246  case SOF0:
247  if (s->got_sof_data > 1) {
248  av_log(avctx, AV_LOG_ERROR,
249  "Multiple SOF in a frame\n");
250  return AVERROR_INVALIDDATA;
251  }
252  ret = ff_mjpeg_decode_sof(jpg);
253  if (ret < 0) {
254  av_log(avctx, AV_LOG_ERROR,
255  "SOF data decode error\n");
256  s->got_sof_data = 0;
257  return ret;
258  }
259  if (jpg->interlaced) {
260  av_log(avctx, AV_LOG_ERROR,
261  "Interlaced mode not supported in MxPEG\n");
262  s->got_sof_data = 0;
263  return AVERROR(EINVAL);
264  }
265  s->got_sof_data ++;
266  break;
267  case SOS:
268  if (!s->got_sof_data) {
269  av_log(avctx, AV_LOG_WARNING,
270  "Can not process SOS without SOF data, skipping\n");
271  break;
272  }
273  if (!jpg->got_picture) {
274  if (jpg->first_picture) {
275  av_log(avctx, AV_LOG_WARNING,
276  "First picture has no SOF, skipping\n");
277  break;
278  }
279  if (!s->got_mxm_bitmask){
280  av_log(avctx, AV_LOG_WARNING,
281  "Non-key frame has no MXM, skipping\n");
282  break;
283  }
284  /* use stored SOF data to allocate current picture */
286  if ((ret = ff_get_buffer(avctx, jpg->picture_ptr,
288  return ret;
291  jpg->got_picture = 1;
292  } else {
295  }
296 
297  if (s->got_mxm_bitmask) {
298  AVFrame *reference_ptr = s->picture[s->picture_index ^ 1];
299  if (mxpeg_check_dimensions(s, jpg, reference_ptr) < 0)
300  break;
301 
302  /* allocate dummy reference picture if needed */
303  if (!reference_ptr->data[0] &&
304  (ret = ff_get_buffer(avctx, reference_ptr,
306  return ret;
307 
308  ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, s->bitmask_size, reference_ptr);
309  if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
310  return ret;
311  } else {
312  ret = ff_mjpeg_decode_sos(jpg, NULL, 0, NULL);
313  if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
314  return ret;
315  }
316 
317  break;
318  }
319 
320  buf_ptr += (get_bits_count(&jpg->gb)+7) >> 3;
321  }
322 
323  }
324 
325 the_end:
326  if (jpg->got_picture) {
327  int ret = av_frame_ref(rframe, jpg->picture_ptr);
328  if (ret < 0)
329  return ret;
330  *got_frame = 1;
331 
332  s->picture_index ^= 1;
333  jpg->picture_ptr = s->picture[s->picture_index];
334 
335  if (!s->has_complete_frame) {
336  if (!s->got_mxm_bitmask)
337  s->has_complete_frame = 1;
338  else
339  *got_frame = 0;
340  }
341  }
342 
343  return buf_ptr - buf;
344 }
345 
347  .p.name = "mxpeg",
348  CODEC_LONG_NAME("Mobotix MxPEG video"),
349  .p.type = AVMEDIA_TYPE_VIDEO,
350  .p.id = AV_CODEC_ID_MXPEG,
351  .priv_data_size = sizeof(MXpegDecodeContext),
353  .close = mxpeg_decode_end,
355  .p.capabilities = AV_CODEC_CAP_DR1,
356  .p.max_lowres = 3,
357  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
358 };
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:215
mjpeg.h
AV_EF_EXPLODE
#define AV_EF_EXPLODE
abort decoding on minor error detection
Definition: defs.h:51
MJpegDecodeContext::avctx
AVCodecContext * avctx
Definition: mjpegdec.h:56
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
MJpegDecodeContext::height
int height
Definition: mjpegdec.h:91
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
SOS
@ SOS
Definition: mjpeg.h:72
MXpegDecodeContext::mb_width
unsigned mb_width
Definition: mxpegdec.c:44
SOF0
@ SOF0
Definition: mjpeg.h:39
AVCodecContext::err_recognition
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
Definition: avcodec.h:1430
get_bits_count
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:266
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:162
mjpegdec.h
start_code
static const uint8_t start_code[]
Definition: videotoolboxenc.c:221
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
AVPacket::data
uint8_t * data
Definition: packet.h:539
MXpegDecodeContext::got_mxm_bitmask
int got_mxm_bitmask
Definition: mxpegdec.c:39
MJpegDecodeContext::first_picture
int first_picture
Definition: mjpegdec.h:69
FFCodec
Definition: codec_internal.h:127
AVFrame::flags
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition: frame.h:661
MXpegDecodeContext::mb_height
unsigned mb_height
Definition: mxpegdec.c:44
AV_CODEC_ID_MXPEG
@ AV_CODEC_ID_MXPEG
Definition: codec_id.h:198
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:514
MXpegDecodeContext
Definition: mxpegdec.c:34
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:410
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
APP15
@ APP15
Definition: mjpeg.h:94
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:381
ff_mjpeg_decode_dht
int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
Definition: mjpegdec.c:241
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
ff_mjpeg_decode_init
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
Definition: mjpegdec.c:124
AVCodecContext::skip_frame
enum AVDiscard skip_frame
Skip decoding for selected frames.
Definition: avcodec.h:1830
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:150
MJpegDecodeContext::picture_ptr
AVFrame * picture_ptr
Definition: mjpegdec.h:109
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
av_cold
#define av_cold
Definition: attributes.h:90
COM
@ COM
Definition: mjpeg.h:111
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:640
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
MXpegDecodeContext::picture
AVFrame * picture[2]
Definition: mxpegdec.c:36
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_GET_BUFFER_FLAG_REF
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
Definition: avcodec.h:431
MJpegDecodeContext::interlaced
int interlaced
Definition: mjpegdec.h:70
mxpeg_decode_mxm
static int mxpeg_decode_mxm(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:91
decode.h
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
ff_mjpeg_decode_end
av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
Definition: mjpegdec.c:2934
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
AVDISCARD_ALL
@ AVDISCARD_ALL
discard all
Definition: defs.h:221
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
ff_mjpeg_decode_dqt
int ff_mjpeg_decode_dqt(MJpegDecodeContext *s)
Definition: mjpegdec.c:198
MJpegDecodeContext::gb
GetBitContext gb
Definition: mjpegdec.h:57
MXpegDecodeContext::mxm_bitmask
uint8_t * mxm_bitmask
Definition: mxpegdec.c:40
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:279
MJpegDecodeContext
Definition: mjpegdec.h:54
ff_mxpeg_decoder
const FFCodec ff_mxpeg_decoder
Definition: mxpegdec.c:346
MJpegDecodeContext::width
int width
Definition: mjpegdec.h:91
AVFrame::pict_type
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:491
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1697
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVPacket::size
int size
Definition: packet.h:540
av_frame_ref
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
Definition: frame.c:388
codec_internal.h
ff_mjpeg_decode_sos
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, int mb_bitmask_size, const AVFrame *reference)
Definition: mjpegdec.c:1667
MXpegDecodeContext::picture_index
int picture_index
Definition: mxpegdec.c:37
DQT
@ DQT
Definition: mjpeg.h:73
mxpeg_decode_app
static int mxpeg_decode_app(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:79
MXpegDecodeContext::got_sof_data
int got_sof_data
Definition: mxpegdec.c:38
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
EOI
@ EOI
Definition: mjpeg.h:71
mxpeg_decode_init
static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
Definition: mxpegdec.c:66
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
av_frame_unref
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Definition: frame.c:610
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:256
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
len
int len
Definition: vorbis_enc_data.h:426
DHT
@ DHT
Definition: mjpeg.h:56
mxpeg_decode_end
static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
Definition: mxpegdec.c:47
MXpegDecodeContext::jpg
MJpegDecodeContext jpg
Definition: mxpegdec.c:35
mxpeg_check_dimensions
static int mxpeg_check_dimensions(MXpegDecodeContext *s, MJpegDecodeContext *jpg, AVFrame *reference_ptr)
Definition: mxpegdec.c:159
ret
ret
Definition: filter_design.txt:187
mxpeg_decode_frame
static int mxpeg_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: mxpegdec.c:184
ff_mjpeg_find_marker
int ff_mjpeg_find_marker(MJpegDecodeContext *s, const uint8_t **buf_ptr, const uint8_t *buf_end, const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size)
Definition: mjpegdec.c:2236
MXpegDecodeContext::bitmask_size
unsigned bitmask_size
Definition: mxpegdec.c:41
AVCodecContext
main external API structure.
Definition: avcodec.h:451
ff_mjpeg_decode_sof
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
Definition: mjpegdec.c:302
APP0
@ APP0
Definition: mjpeg.h:79
MJpegDecodeContext::got_picture
int got_picture
we found a SOF and picture is valid, too.
Definition: mjpegdec.h:110
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:280
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
mem.h
SOI
@ SOI
Definition: mjpeg.h:70
AVPacket
This structure stores compressed data.
Definition: packet.h:516
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:478
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
MAX_COMPONENTS
#define MAX_COMPONENTS
Definition: mjpegdec.h:45
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:434
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
mxpeg_decode_com
static int mxpeg_decode_com(MXpegDecodeContext *s, const uint8_t *buf_ptr, int buf_size)
Definition: mxpegdec.c:144
MXpegDecodeContext::has_complete_frame
int has_complete_frame
Definition: mxpegdec.c:42
AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:98
MXpegDecodeContext::completion_bitmask
uint8_t * completion_bitmask
Definition: mxpegdec.c:43