3 * Copyright (c) 2000,2001 Fabrice Bellard
4 * Copyright (c) 2002-2004 Michael Niedermayer
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 #include "libavutil/imgutils.h"
31 #include "libavutil/thread.h"
34 #include "error_resilience.h"
39 #include "mpegutils.h"
40 #include "mpegvideo.h"
41 #include "mpeg4video.h"
42 #include "mpegvideodata.h"
45 #define RV_GET_MAJOR_VER(x) ((x) >> 28)
46 #define RV_GET_MINOR_VER(x) (((x) >> 20) & 0xFF)
47 #define RV_GET_MICRO_VER(x) (((x) >> 12) & 0xFF)
49 #define MAX_VLC_ENTRIES 1023 // Note: Does not include the skip entries.
50 #define DC_VLC_BITS 14 // FIXME find a better solution
52 typedef struct RVDecContext {
55 int orig_width, orig_height;
58 /* (run, length) encoded value for the symbols table. The actual symbols
59 * are run..run + length (mod 256).
60 * The last two entries in the following table apply to luma only.
61 * The skip values are not included in this list. */
62 static const uint8_t rv_sym_run_len[][2] = {
63 { 128, 0 }, { 127, 0 }, { 129, 0 }, { 125, 1 }, { 130, 1 },
64 { 121, 3 }, { 132, 3 }, { 113, 7 }, { 136, 7 }, { 97, 15 },
65 { 144, 15 }, { 65, 31 }, { 160, 31 }, { 1, 63 }, { 192, 63 },
66 { 129, 127 }, { 0, 127 }, { 1, 255 }, { 0, 255 },
69 /* entry[i] of the following tables gives
70 * the number of VLC codes of length i + 2. */
71 static const uint16_t rv_lum_len_count[15] = {
72 1, 0, 2, 4, 8, 16, 32, 0, 64, 0, 128, 0, 256, 0, 512,
75 static const uint16_t rv_chrom_len_count[15] = {
76 1, 2, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256,
79 static VLC rv_dc_lum, rv_dc_chrom;
81 int ff_rv_decode_dc(MpegEncContext *s, int n)
86 code = get_vlc2(&s->gb, rv_dc_lum.table, DC_VLC_BITS, 2);
88 /* Skip entry - no error. */
89 skip_bits(&s->gb, 18);
95 code = get_vlc2(&s->gb, rv_dc_chrom.table, DC_VLC_BITS, 2);
97 if (show_bits(&s->gb, 9) == 0x1FE) {
98 /* Skip entry - no error. */
99 skip_bits(&s->gb, 18);
102 av_log(s->avctx, AV_LOG_ERROR, "chroma dc error\n");
112 /* read RV 1.0 compatible frame header */
113 static int rv10_decode_picture_header(MpegEncContext *s)
115 int mb_count, pb_frame, marker, mb_xy;
117 marker = get_bits1(&s->gb);
119 if (get_bits1(&s->gb))
120 s->pict_type = AV_PICTURE_TYPE_P;
122 s->pict_type = AV_PICTURE_TYPE_I;
125 av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
127 pb_frame = get_bits1(&s->gb);
129 ff_dlog(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
132 avpriv_request_sample(s->avctx, "PB-frame");
133 return AVERROR_PATCHWELCOME;
136 s->qscale = get_bits(&s->gb, 5);
137 if (s->qscale == 0) {
138 av_log(s->avctx, AV_LOG_ERROR, "Invalid qscale value: 0\n");
139 return AVERROR_INVALIDDATA;
142 if (s->pict_type == AV_PICTURE_TYPE_I) {
143 if (s->rv10_version == 3) {
144 /* specific MPEG like DC coding not used */
145 s->last_dc[0] = get_bits(&s->gb, 8);
146 s->last_dc[1] = get_bits(&s->gb, 8);
147 s->last_dc[2] = get_bits(&s->gb, 8);
148 ff_dlog(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
149 s->last_dc[1], s->last_dc[2]);
152 /* if multiple packets per frame are sent, the position at which
153 * to display the macroblocks is coded here */
155 mb_xy = s->mb_x + s->mb_y * s->mb_width;
156 if (show_bits(&s->gb, 12) == 0 || (mb_xy && mb_xy < s->mb_num)) {
157 s->mb_x = get_bits(&s->gb, 6); /* mb_x */
158 s->mb_y = get_bits(&s->gb, 6); /* mb_y */
159 mb_count = get_bits(&s->gb, 12);
163 mb_count = s->mb_width * s->mb_height;
165 skip_bits(&s->gb, 3); /* ignored */
167 s->unrestricted_mv = 1;
172 static int rv20_decode_picture_header(RVDecContext *rv)
174 MpegEncContext *s = &rv->m;
175 int seq, mb_pos, i, ret;
178 i = get_bits(&s->gb, 2);
181 s->pict_type = AV_PICTURE_TYPE_I;
184 s->pict_type = AV_PICTURE_TYPE_I;
187 s->pict_type = AV_PICTURE_TYPE_P;
190 s->pict_type = AV_PICTURE_TYPE_B;
193 av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
194 return AVERROR_INVALIDDATA;
197 if (s->low_delay && s->pict_type == AV_PICTURE_TYPE_B) {
198 av_log(s->avctx, AV_LOG_ERROR, "low delay B\n");
201 if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) {
202 av_log(s->avctx, AV_LOG_ERROR, "early B-frame\n");
203 return AVERROR_INVALIDDATA;
206 if (get_bits1(&s->gb)) {
207 av_log(s->avctx, AV_LOG_ERROR, "reserved bit set\n");
208 return AVERROR_INVALIDDATA;
211 s->qscale = get_bits(&s->gb, 5);
212 if (s->qscale == 0) {
213 av_log(s->avctx, AV_LOG_ERROR, "Invalid qscale value: 0\n");
214 return AVERROR_INVALIDDATA;
217 if (RV_GET_MINOR_VER(rv->sub_id) >= 2)
218 s->loop_filter = get_bits1(&s->gb) && !s->avctx->lowres;
220 if (RV_GET_MINOR_VER(rv->sub_id) <= 1)
221 seq = get_bits(&s->gb, 8) << 7;
223 seq = get_bits(&s->gb, 13) << 2;
225 rpr_max = s->avctx->extradata[1] & 7;
228 int rpr_bits = av_log2(rpr_max) + 1;
230 f = get_bits(&s->gb, rpr_bits);
233 if (s->avctx->extradata_size < 8 + 2 * f) {
234 av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n");
235 return AVERROR_INVALIDDATA;
238 new_w = 4 * ((uint8_t *) s->avctx->extradata)[6 + 2 * f];
239 new_h = 4 * ((uint8_t *) s->avctx->extradata)[7 + 2 * f];
241 new_w = rv->orig_width;
242 new_h = rv->orig_height;
244 if (new_w != s->width || new_h != s->height) {
245 AVRational old_aspect = s->avctx->sample_aspect_ratio;
246 av_log(s->avctx, AV_LOG_DEBUG,
247 "attempting to change resolution to %dx%d\n", new_w, new_h);
248 if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0)
249 return AVERROR_INVALIDDATA;
250 ff_mpv_common_end(s);
252 // attempt to keep aspect during typical resolution switches
254 old_aspect = (AVRational){1, 1};
255 if (2 * (int64_t)new_w * s->height == (int64_t)new_h * s->width)
256 s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){2, 1});
257 if ((int64_t)new_w * s->height == 2 * (int64_t)new_h * s->width)
258 s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){1, 2});
260 ret = ff_set_dimensions(s->avctx, new_w, new_h);
266 if ((ret = ff_mpv_common_init(s)) < 0)
270 if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
271 av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d/%d\n", f, rpr_bits, rpr_max);
274 if (av_image_check_size(s->width, s->height, 0, s->avctx) < 0)
275 return AVERROR_INVALIDDATA;
277 mb_pos = ff_h263_decode_mba(s);
279 seq |= s->time & ~0x7FFF;
280 if (seq - s->time > 0x4000)
282 if (seq - s->time < -0x4000)
285 if (seq != s->time) {
286 if (s->pict_type != AV_PICTURE_TYPE_B) {
288 s->pp_time = s->time - s->last_non_b_time;
289 s->last_non_b_time = s->time;
292 s->pb_time = s->pp_time - (s->last_non_b_time - s->time);
295 if (s->pict_type == AV_PICTURE_TYPE_B) {
296 if (s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0) {
297 av_log(s->avctx, AV_LOG_DEBUG,
298 "messed up order, possible from seeking? skipping current B-frame\n");
299 #define ERROR_SKIP_FRAME -123
300 return ERROR_SKIP_FRAME;
302 ff_mpeg4_init_direct_mv(s);
305 s->no_rounding = get_bits1(&s->gb);
307 if (RV_GET_MINOR_VER(rv->sub_id) <= 1 && s->pict_type == AV_PICTURE_TYPE_B)
308 // binary decoder reads 3+2 bits here but they don't seem to be used
309 skip_bits(&s->gb, 5);
312 s->unrestricted_mv = 1;
313 s->h263_aic = s->pict_type == AV_PICTURE_TYPE_I;
314 s->modified_quant = 1;
315 if (!s->avctx->lowres)
318 if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
319 av_log(s->avctx, AV_LOG_INFO,
320 "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
321 seq, s->mb_x, s->mb_y, s->pict_type, s->qscale,
325 av_assert0(s->pict_type != AV_PICTURE_TYPE_B || !s->low_delay);
327 return s->mb_width * s->mb_height - mb_pos;
330 static av_cold void rv10_build_vlc(VLC *vlc, const uint16_t len_count[15],
331 const uint8_t sym_rl[][2], int sym_rl_elems)
333 uint16_t syms[MAX_VLC_ENTRIES];
334 uint8_t lens[MAX_VLC_ENTRIES];
335 unsigned nb_syms = 0, nb_lens = 0;
337 for (unsigned i = 0; i < sym_rl_elems; i++) {
338 unsigned cur_sym = sym_rl[i][0];
339 for (unsigned tmp = nb_syms + sym_rl[i][1]; nb_syms <= tmp; nb_syms++)
340 syms[nb_syms] = 0xFF & cur_sym++;
343 for (unsigned i = 0; i < 15; i++)
344 for (unsigned tmp = nb_lens + len_count[i]; nb_lens < tmp; nb_lens++)
345 lens[nb_lens] = i + 2;
346 av_assert1(nb_lens == nb_syms);
347 ff_init_vlc_from_lengths(vlc, DC_VLC_BITS, nb_lens, lens, 1,
348 syms, 2, 2, 0, INIT_VLC_STATIC_OVERLONG, NULL);
351 static av_cold void rv10_init_static(void)
353 static VLC_TYPE table[16896 + 16640][2];
355 rv_dc_lum.table = table;
356 rv_dc_lum.table_allocated = 16896;
357 rv10_build_vlc(&rv_dc_lum, rv_lum_len_count,
358 rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len));
359 rv_dc_chrom.table = &table[16896];
360 rv_dc_chrom.table_allocated = 16640;
361 rv10_build_vlc(&rv_dc_chrom, rv_chrom_len_count,
362 rv_sym_run_len, FF_ARRAY_ELEMS(rv_sym_run_len) - 2);
363 ff_h263_decode_init_vlc();
366 static av_cold int rv10_decode_init(AVCodecContext *avctx)
368 static AVOnce init_static_once = AV_ONCE_INIT;
369 RVDecContext *rv = avctx->priv_data;
370 MpegEncContext *s = &rv->m;
371 int major_ver, minor_ver, micro_ver, ret;
373 if (avctx->extradata_size < 8) {
374 av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
375 return AVERROR_INVALIDDATA;
377 if ((ret = av_image_check_size(avctx->coded_width,
378 avctx->coded_height, 0, avctx)) < 0)
381 ff_mpv_decode_defaults(s);
382 ff_mpv_decode_init(s, avctx);
384 s->out_format = FMT_H263;
387 s->width = avctx->coded_width;
389 s->height = avctx->coded_height;
391 s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1;
392 rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4);
394 major_ver = RV_GET_MAJOR_VER(rv->sub_id);
395 minor_ver = RV_GET_MINOR_VER(rv->sub_id);
396 micro_ver = RV_GET_MICRO_VER(rv->sub_id);
401 s->rv10_version = micro_ver ? 3 : 1;
402 s->obmc = micro_ver == 2;
405 if (minor_ver >= 2) {
407 s->avctx->has_b_frames = 1;
411 av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", rv->sub_id);
412 avpriv_request_sample(avctx, "RV1/2 version");
413 return AVERROR_PATCHWELCOME;
416 if (avctx->debug & FF_DEBUG_PICT_INFO) {
417 av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%"PRIX32"\n", rv->sub_id,
418 ((uint32_t *) avctx->extradata)[0]);
421 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
424 if ((ret = ff_mpv_common_init(s)) < 0)
427 ff_h263dsp_init(&s->h263dsp);
429 /* init static VLCs */
430 ff_thread_once(&init_static_once, rv10_init_static);
435 static av_cold int rv10_decode_end(AVCodecContext *avctx)
437 MpegEncContext *s = avctx->priv_data;
439 ff_mpv_common_end(s);
443 static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
444 int buf_size, int buf_size2, int whole_size)
446 RVDecContext *rv = avctx->priv_data;
447 MpegEncContext *s = &rv->m;
448 int mb_count, mb_pos, left, start_mb_x, active_bits_size, ret;
450 active_bits_size = buf_size * 8;
451 init_get_bits(&s->gb, buf, FFMAX(buf_size, buf_size2) * 8);
452 if (s->codec_id == AV_CODEC_ID_RV10)
453 mb_count = rv10_decode_picture_header(s);
455 mb_count = rv20_decode_picture_header(rv);
457 if (mb_count != ERROR_SKIP_FRAME)
458 av_log(s->avctx, AV_LOG_ERROR, "HEADER ERROR\n");
459 return AVERROR_INVALIDDATA;
462 if (s->mb_x >= s->mb_width ||
463 s->mb_y >= s->mb_height) {
464 av_log(s->avctx, AV_LOG_ERROR, "POS ERROR %d %d\n", s->mb_x, s->mb_y);
465 return AVERROR_INVALIDDATA;
467 mb_pos = s->mb_y * s->mb_width + s->mb_x;
468 left = s->mb_width * s->mb_height - mb_pos;
469 if (mb_count > left) {
470 av_log(s->avctx, AV_LOG_ERROR, "COUNT ERROR\n");
471 return AVERROR_INVALIDDATA;
474 if (whole_size < s->mb_width * s->mb_height / 8)
475 return AVERROR_INVALIDDATA;
477 if ((s->mb_x == 0 && s->mb_y == 0) || !s->current_picture_ptr) {
478 // FIXME write parser so we always have complete frames?
479 if (s->current_picture_ptr) {
480 ff_er_frame_end(&s->er);
482 s->mb_x = s->mb_y = s->resync_mb_x = s->resync_mb_y = 0;
484 if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
486 ff_mpeg_er_frame_start(s);
488 if (s->current_picture_ptr->f->pict_type != s->pict_type) {
489 av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
490 return AVERROR_INVALIDDATA;
495 ff_dlog(avctx, "qscale=%d\n", s->qscale);
497 /* default quantization values */
498 if (s->codec_id == AV_CODEC_ID_RV10) {
500 s->first_slice_line = 1;
502 s->first_slice_line = 1;
503 s->resync_mb_x = s->mb_x;
505 start_mb_x = s->mb_x;
506 s->resync_mb_y = s->mb_y;
508 s->y_dc_scale_table =
509 s->c_dc_scale_table = ff_aic_dc_scale_table;
511 s->y_dc_scale_table =
512 s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
515 if (s->modified_quant)
516 s->chroma_qscale_table = ff_h263_chroma_qscale_table;
518 ff_set_qscale(s, s->qscale);
520 s->rv10_first_dc_coded[0] = 0;
521 s->rv10_first_dc_coded[1] = 0;
522 s->rv10_first_dc_coded[2] = 0;
526 s->block_wrap[3] = s->b8_stride;
528 s->block_wrap[5] = s->mb_stride;
529 ff_init_block_index(s);
531 /* decode each macroblock */
532 for (s->mb_num_left = mb_count; s->mb_num_left > 0; s->mb_num_left--) {
534 ff_update_block_index(s);
535 ff_tlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
537 s->mv_dir = MV_DIR_FORWARD;
538 s->mv_type = MV_TYPE_16X16;
539 ret = ff_h263_decode_mb(s, s->block);
541 // Repeat the slice end check from ff_h263_decode_mb with our active
543 if (ret != SLICE_ERROR && active_bits_size >= get_bits_count(&s->gb)) {
544 int v = show_bits(&s->gb, 16);
546 if (get_bits_count(&s->gb) + 16 > active_bits_size)
547 v >>= get_bits_count(&s->gb) + 16 - active_bits_size;
552 if (ret != SLICE_ERROR && active_bits_size < get_bits_count(&s->gb) &&
553 8 * buf_size2 >= get_bits_count(&s->gb)) {
554 active_bits_size = buf_size2 * 8;
555 av_log(avctx, AV_LOG_DEBUG, "update size from %d to %d\n",
556 8 * buf_size, active_bits_size);
560 if (ret == SLICE_ERROR || active_bits_size < get_bits_count(&s->gb)) {
561 av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x,
563 return AVERROR_INVALIDDATA;
565 if (s->pict_type != AV_PICTURE_TYPE_B)
566 ff_h263_update_motion_val(s);
567 ff_mpv_reconstruct_mb(s, s->block);
569 ff_h263_loop_filter(s);
571 if (++s->mb_x == s->mb_width) {
574 ff_init_block_index(s);
576 if (s->mb_x == s->resync_mb_x)
577 s->first_slice_line = 0;
578 if (ret == SLICE_END)
582 ff_er_add_slice(&s->er, start_mb_x, s->resync_mb_y, s->mb_x - 1, s->mb_y,
585 return active_bits_size;
588 static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
590 if (avctx->slice_count)
591 return avctx->slice_offset[n];
593 return AV_RL32(buf + n * 8);
596 static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
599 const uint8_t *buf = avpkt->data;
600 int buf_size = avpkt->size;
601 MpegEncContext *s = avctx->priv_data;
602 AVFrame *pict = data;
605 const uint8_t *slices_hdr = NULL;
607 ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
609 /* no supplementary picture */
614 if (!avctx->slice_count) {
615 slice_count = (*buf++) + 1;
618 if (!slice_count || buf_size <= 8 * slice_count) {
619 av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n",
621 return AVERROR_INVALIDDATA;
624 slices_hdr = buf + 4;
625 buf += 8 * slice_count;
626 buf_size -= 8 * slice_count;
628 slice_count = avctx->slice_count;
630 for (i = 0; i < slice_count; i++) {
631 unsigned offset = get_slice_offset(avctx, slices_hdr, i);
634 if (offset >= buf_size)
635 return AVERROR_INVALIDDATA;
637 if (i + 1 == slice_count)
638 size = buf_size - offset;
640 size = get_slice_offset(avctx, slices_hdr, i + 1) - offset;
642 if (i + 2 >= slice_count)
643 size2 = buf_size - offset;
645 size2 = get_slice_offset(avctx, slices_hdr, i + 2) - offset;
647 if (size <= 0 || size2 <= 0 ||
648 offset + FFMAX(size, size2) > buf_size)
649 return AVERROR_INVALIDDATA;
651 if ((ret = rv10_decode_packet(avctx, buf + offset, size, size2, buf_size)) < 0)
658 if (s->current_picture_ptr && s->mb_y >= s->mb_height) {
659 ff_er_frame_end(&s->er);
662 if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
663 if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)
665 ff_print_debug_info(s, s->current_picture_ptr, pict);
666 ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1);
667 } else if (s->last_picture_ptr) {
668 if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
670 ff_print_debug_info(s, s->last_picture_ptr, pict);
671 ff_mpv_export_qp_table(s, pict,s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1);
674 if (s->last_picture_ptr || s->low_delay) {
678 // so we can detect if frame_end was not called (find some nicer solution...)
679 s->current_picture_ptr = NULL;
685 AVCodec ff_rv10_decoder = {
687 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
688 .type = AVMEDIA_TYPE_VIDEO,
689 .id = AV_CODEC_ID_RV10,
690 .priv_data_size = sizeof(RVDecContext),
691 .init = rv10_decode_init,
692 .close = rv10_decode_end,
693 .decode = rv10_decode_frame,
694 .capabilities = AV_CODEC_CAP_DR1,
695 .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
697 .pix_fmts = (const enum AVPixelFormat[]) {
703 AVCodec ff_rv20_decoder = {
705 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
706 .type = AVMEDIA_TYPE_VIDEO,
707 .id = AV_CODEC_ID_RV20,
708 .priv_data_size = sizeof(RVDecContext),
709 .init = rv10_decode_init,
710 .close = rv10_decode_end,
711 .decode = rv10_decode_frame,
712 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
713 .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
714 .flush = ff_mpeg_flush,
716 .pix_fmts = (const enum AVPixelFormat[]) {