aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-19 15:21:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-19 15:54:36 +0100
commit002ad7cd3901fe6e022f5f542d36e327bdbd7f50 (patch)
tree63341faa2457aa8a694ff4b5f11b7ac06e1f90cb
parent397fafad230a7d4f2d2c0908ae56418318e82148 (diff)
parent0a837b631757a7407df038248eea5e9e79b1cb79 (diff)
downloadffmpeg-002ad7cd3901fe6e022f5f542d36e327bdbd7f50.tar.gz
Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9: fate: update ref after rv30_loop_filter fix rv30: fix masking in rv30_loop_filter() libcdio: support recent cdio-paranoia theora: Skip zero-sized headers h264: add 3 pixels below for subpixel filter wait position h264: fix ff_generate_sliding_window_mmcos() prototype. h264: don't clobber mmco opcode tables for non-first slice headers. Conflicts: configure libavcodec/h264_refs.c tests/ref/fate/filter-delogo tests/ref/fate/rv30 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure6
-rw-r--r--libavcodec/h264.c21
-rw-r--r--libavcodec/h264.h5
-rw-r--r--libavcodec/h264_refs.c150
-rw-r--r--libavcodec/rv30.c4
-rw-r--r--libavcodec/vp3.c2
-rw-r--r--libavdevice/libcdio.c7
-rw-r--r--tests/ref/fate/filter-delogo164
-rw-r--r--tests/ref/fate/rv30164
9 files changed, 305 insertions, 218 deletions
diff --git a/configure b/configure
index 4dd265f502..0707a940c4 100755
--- a/configure
+++ b/configure
@@ -1343,6 +1343,8 @@ HAVE_LIST="
asm_types_h
attribute_may_alias
attribute_packed
+ cdio_paranoia_h
+ cdio_paranoia_paranoia_h
clock_gettime
closesocket
cmov
@@ -3817,7 +3819,6 @@ enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_c
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
-enabled libcdio && require2 libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
@@ -3954,6 +3955,9 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_fu
enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
+if enabled libcdio; then
+ check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
+fi
enabled x11grab &&
require X11 X11/Xlib.h XOpenDisplay -lX11 &&
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d5009bfb80..7ae778a58c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -309,10 +309,11 @@ static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n,
int height, int y_offset, int list)
{
int raw_my = h->mv_cache[list][scan8[n]][1];
- int filter_height = (raw_my & 3) ? 2 : 0;
+ int filter_height_up = (raw_my & 3) ? 2 : 0;
+ int filter_height_down = (raw_my & 3) ? 3 : 0;
int full_my = (raw_my >> 2) + y_offset;
- int top = full_my - filter_height;
- int bottom = full_my + filter_height + height;
+ int top = full_my - filter_height_up;
+ int bottom = full_my + filter_height_down + height;
return FFMAX(abs(top), bottom);
}
@@ -2973,7 +2974,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
s->current_picture_ptr->frame_num = h->prev_frame_num;
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0);
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 1);
- ff_generate_sliding_window_mmcos(h);
+ if ((ret = ff_generate_sliding_window_mmcos(h, 1)) < 0 &&
+ s->avctx->err_recognition & AV_EF_EXPLODE)
+ return ret;
if (ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index) < 0 &&
(s->avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
@@ -3152,7 +3155,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
}
}
- if (h->nal_ref_idc && ff_h264_decode_ref_pic_marking(h0, &s->gb) < 0 &&
+ // If frame-mt is enabled, only update mmco tables for the first slice
+ // in a field. Subsequent slices can temporarily clobber h->mmco_index
+ // or h->mmco, which will cause ref list mix-ups and decoding errors
+ // further down the line. This may break decoding if the first slice is
+ // corrupt, thus we only do this if frame-mt is enabled.
+ if (h->nal_ref_idc &&
+ ff_h264_decode_ref_pic_marking(h0, &s->gb,
+ !(s->avctx->active_thread_type & FF_THREAD_FRAME) ||
+ h0->current_slice == 0) < 0 &&
(s->avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 3355d05e97..4b6a19ed4a 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -669,9 +669,10 @@ void ff_h264_remove_all_refs(H264Context *h);
*/
int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count);
-int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb);
+int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
+ int first_slice);
-void ff_generate_sliding_window_mmcos(H264Context *h);
+int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice);
/**
* Check if the top & left blocks are available if needed & change the
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 812913a612..d09f15cacd 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -480,22 +480,50 @@ static void print_long_term(H264Context *h) {
}
}
-void ff_generate_sliding_window_mmcos(H264Context *h) {
- MpegEncContext * const s = &h->s;
+static int check_opcodes(MMCO *mmco1, MMCO *mmco2, int n_mmcos)
+{
+ int i;
+
+ for (i = 0; i < n_mmcos; i++) {
+ if (mmco1[i].opcode != mmco2[i].opcode)
+ return -1;
+ }
+
+ return 0;
+}
- h->mmco_index= 0;
- if(h->short_ref_count && h->long_ref_count + h->short_ref_count >= h->sps.ref_frame_count &&
- !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->f.reference)) {
- h->mmco[0].opcode= MMCO_SHORT2UNUSED;
- h->mmco[0].short_pic_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num;
- h->mmco_index= 1;
+int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)
+{
+ MpegEncContext * const s = &h->s;
+ MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
+ int mmco_index = 0, i;
+
+ if (h->short_ref_count &&
+ h->long_ref_count + h->short_ref_count >= h->sps.ref_frame_count &&
+ !(FIELD_PICTURE && !s->first_field &&
+ s->current_picture_ptr->f.reference)) {
+ mmco[0].opcode = MMCO_SHORT2UNUSED;
+ mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;
+ mmco_index = 1;
if (FIELD_PICTURE) {
- h->mmco[0].short_pic_num *= 2;
- h->mmco[1].opcode= MMCO_SHORT2UNUSED;
- h->mmco[1].short_pic_num= h->mmco[0].short_pic_num + 1;
- h->mmco_index= 2;
+ mmco[0].short_pic_num *= 2;
+ mmco[1].opcode = MMCO_SHORT2UNUSED;
+ mmco[1].short_pic_num = mmco[0].short_pic_num + 1;
+ mmco_index = 2;
}
}
+
+ if (first_slice) {
+ h->mmco_index = mmco_index;
+ } else if (!first_slice && mmco_index >= 0 &&
+ (mmco_index != h->mmco_index ||
+ (i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {
+ av_log(h->s.avctx, AV_LOG_ERROR,
+ "Inconsistent MMCO state between slices [%d, %d, %d]\n",
+ mmco_index, h->mmco_index, i);
+ return AVERROR_INVALIDDATA;
+ }
+ return 0;
}
int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
@@ -665,52 +693,86 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
return (h->s.avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
}
-int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
+int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
+ int first_slice)
+{
MpegEncContext * const s = &h->s;
- int i;
-
- h->mmco_index= 0;
- if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields
- s->broken_link= get_bits1(gb) -1;
- if(get_bits1(gb)){
- h->mmco[0].opcode= MMCO_LONG;
- h->mmco[0].long_arg= 0;
- h->mmco_index= 1;
+ int i, ret;
+ MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
+ int mmco_index = 0;
+
+ if (h->nal_unit_type == NAL_IDR_SLICE){ // FIXME fields
+ s->broken_link = get_bits1(gb) - 1;
+ if (get_bits1(gb)){
+ mmco[0].opcode = MMCO_LONG;
+ mmco[0].long_arg = 0;
+ mmco_index = 1;
}
- }else{
- if(get_bits1(gb)){ // adaptive_ref_pic_marking_mode_flag
- for(i= 0; i<MAX_MMCO_COUNT; i++) {
- MMCOOpcode opcode= get_ue_golomb_31(gb);
-
- h->mmco[i].opcode= opcode;
- if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){
- h->mmco[i].short_pic_num= (h->curr_pic_num - get_ue_golomb(gb) - 1) & (h->max_pic_num - 1);
-/* if(h->mmco[i].short_pic_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_pic_num ] == NULL){
- av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco);
+ } else {
+ if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
+ for (i = 0; i < MAX_MMCO_COUNT; i++) {
+ MMCOOpcode opcode = get_ue_golomb_31(gb);
+
+ mmco[i].opcode = opcode;
+ if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG){
+ mmco[i].short_pic_num =
+ (h->curr_pic_num - get_ue_golomb(gb) - 1) &
+ (h->max_pic_num - 1);
+#if 0
+ if (mmco[i].short_pic_num >= h->short_ref_count ||
+ h->short_ref[ mmco[i].short_pic_num ] == NULL){
+ av_log(s->avctx, AV_LOG_ERROR,
+ "illegal short ref in memory management control "
+ "operation %d\n", mmco);
return -1;
- }*/
+ }
+#endif
}
- if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){
- unsigned int long_arg= get_ue_golomb_31(gb);
- if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG && long_arg == 16) && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode);
+ if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
+ opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG) {
+ unsigned int long_arg = get_ue_golomb_31(gb);
+ if (long_arg >= 32 ||
+ (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG &&
+ long_arg == 16) &&
+ !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
+ av_log(h->s.avctx, AV_LOG_ERROR,
+ "illegal long ref in memory management control "
+ "operation %d\n", opcode);
return -1;
}
- h->mmco[i].long_arg= long_arg;
+ mmco[i].long_arg = long_arg;
}
- if(opcode > (unsigned)MMCO_LONG){
- av_log(h->s.avctx, AV_LOG_ERROR, "illegal memory management control operation %d\n", opcode);
+ if (opcode > (unsigned) MMCO_LONG){
+ av_log(h->s.avctx, AV_LOG_ERROR,
+ "illegal memory management control operation %d\n",
+ opcode);
return -1;
}
- if(opcode == MMCO_END)
+ if (opcode == MMCO_END)
break;
}
- h->mmco_index= i;
- }else{
- ff_generate_sliding_window_mmcos(h);
+ mmco_index = i;
+ } else {
+ if (first_slice) {
+ ret = ff_generate_sliding_window_mmcos(h, first_slice);
+ if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
+ return ret;
+ }
+ mmco_index = -1;
}
}
+ if (first_slice && mmco_index != -1) {
+ h->mmco_index = mmco_index;
+ } else if (!first_slice && mmco_index >= 0 &&
+ (mmco_index != h->mmco_index ||
+ (i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {
+ av_log(h->s.avctx, AV_LOG_ERROR,
+ "Inconsistent MMCO state between slices [%d, %d, %d]\n",
+ mmco_index, h->mmco_index, i);
+ return AVERROR_INVALIDDATA;
+ }
+
return 0;
}
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index 9d33051354..17f1e99726 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -187,7 +187,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
for(i = !mb_x; i < 2; i++, C += 4){
int ij = i + (j >> 1);
loc_lim = 0;
- if(cur_cbp && (1 << ij))
+ if (cur_cbp & (1 << ij))
loc_lim = cur_lim;
else if(!i && left_cbp & (1 << (ij + 1)))
loc_lim = left_lim;
@@ -229,7 +229,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
for(i = 0; i < 2; i++, C += 4){
int ij = i + (j >> 1);
loc_lim = 0;
- if(r->cbp_chroma[mb_pos] && (1 << ij))
+ if (r->cbp_chroma[mb_pos] & (1 << ij))
loc_lim = cur_lim;
else if(!j && top_cbp & (1 << (ij + 2)))
loc_lim = top_lim;
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index dcc2578b8f..ce3ffe832a 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2339,6 +2339,8 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
}
for(i=0;i<3;i++) {
+ if (header_len[i] <= 0)
+ continue;
init_get_bits(&gb, header_start[i], header_len[i] * 8);
ptype = get_bits(&gb, 8);
diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c
index ec53e2c072..a824bc3882 100644
--- a/libavdevice/libcdio.c
+++ b/libavdevice/libcdio.c
@@ -23,8 +23,15 @@
* libcdio CD grabbing
*/
+#include "config.h"
+
+#if HAVE_CDIO_PARANOIA_H
#include <cdio/cdda.h>
#include <cdio/paranoia.h>
+#elif HAVE_CDIO_PARANOIA_PARANOIA_H
+#include <cdio/paranoia/cdda.h>
+#include <cdio/paranoia/paranoia.h>
+#endif
#include "libavutil/log.h"
#include "libavutil/mem.h"
diff --git a/tests/ref/fate/filter-delogo b/tests/ref/fate/filter-delogo
index e0f24cd8ce..bc58777304 100644
--- a/tests/ref/fate/filter-delogo
+++ b/tests/ref/fate/filter-delogo
@@ -8,13 +8,13 @@
0, 6, 6, 1, 126720, 0x94a0f126
0, 7, 7, 1, 126720, 0x0250f106
0, 8, 8, 1, 126720, 0xcf6ab4bc
-0, 9, 9, 1, 126720, 0x44aeb57c
-0, 10, 10, 1, 126720, 0x33b0b5bc
-0, 11, 11, 1, 126720, 0xc4bab591
+0, 9, 9, 1, 126720, 0x429eb57c
+0, 10, 10, 1, 126720, 0x3bf0b5bc
+0, 11, 11, 1, 126720, 0xcaedb591
0, 12, 12, 1, 126720, 0xa492b5ec
-0, 13, 13, 1, 126720, 0x1459b85c
-0, 14, 14, 1, 126720, 0x806fb8dc
-0, 15, 15, 1, 126720, 0xd241b871
+0, 13, 13, 1, 126720, 0x2431b85c
+0, 14, 14, 1, 126720, 0x8283b8dc
+0, 15, 15, 1, 126720, 0xd71bb871
0, 16, 16, 1, 126720, 0x698eb5cc
0, 17, 17, 1, 126720, 0x4719aa98
0, 18, 18, 1, 126720, 0x9ca1962c
@@ -28,83 +28,83 @@
0, 26, 26, 1, 126720, 0x7af2ea86
0, 27, 27, 1, 126720, 0x40d4b4eb
0, 28, 28, 1, 126720, 0x49d00307
-0, 29, 29, 1, 126720, 0x44c8848e
-0, 30, 30, 1, 126720, 0xc6990101
-0, 31, 31, 1, 126720, 0x2e01b963
+0, 29, 29, 1, 126720, 0x0654849c
+0, 30, 30, 1, 126720, 0xe46d0107
+0, 31, 31, 1, 126720, 0xa483b963
0, 32, 32, 1, 126720, 0xd0e903f0
-0, 33, 33, 1, 126720, 0x3457d592
-0, 34, 34, 1, 126720, 0x4f1ddb3c
-0, 35, 35, 1, 126720, 0x3980ace5
+0, 33, 33, 1, 126720, 0x964ed592
+0, 34, 34, 1, 126720, 0x23fbdb3c
+0, 35, 35, 1, 126720, 0x59fdace5
0, 36, 36, 1, 126720, 0xb1e37954
-0, 37, 37, 1, 126720, 0x619fc554
-0, 38, 38, 1, 126720, 0x945fb39e
-0, 39, 39, 1, 126720, 0xb1d5e0ce
+0, 37, 37, 1, 126720, 0x8ed9c554
+0, 38, 38, 1, 126720, 0xe3c4b39f
+0, 39, 39, 1, 126720, 0xfd17e0ce
0, 40, 40, 1, 126720, 0xf26e1dcc
-0, 41, 41, 1, 126720, 0x04d5783e
-0, 42, 42, 1, 126720, 0xbaa0479e
-0, 43, 43, 1, 126720, 0x20d88b01
+0, 41, 41, 1, 126720, 0x13cc783c
+0, 42, 42, 1, 126720, 0x47ad47a1
+0, 43, 43, 1, 126720, 0x427c8b0d
0, 44, 44, 1, 126720, 0x59d99901
-0, 45, 45, 1, 126720, 0x1c6e09f6
-0, 46, 46, 1, 126720, 0xeec50fc5
-0, 47, 47, 1, 126720, 0xb3a92827
-0, 48, 48, 1, 126720, 0xf62dd2b6
-0, 49, 49, 1, 126720, 0x75b1e619
-0, 50, 50, 1, 126720, 0x6bbce2c0
-0, 51, 51, 1, 126720, 0xd93e023c
-0, 52, 52, 1, 126720, 0xbbe8e7c2
-0, 53, 53, 1, 126720, 0x2272ec17
-0, 54, 54, 1, 126720, 0xf5e4ee6e
-0, 55, 55, 1, 126720, 0x751d2607
-0, 56, 56, 1, 126720, 0x44c499c9
-0, 57, 57, 1, 126720, 0xddccd842
-0, 58, 58, 1, 126720, 0x508dd214
-0, 59, 59, 1, 126720, 0x8eb10272
-0, 60, 60, 1, 126720, 0x7224b1c6
-0, 61, 61, 1, 126720, 0x50ff456c
-0, 62, 62, 1, 126720, 0xa81e2731
-0, 63, 63, 1, 126720, 0x7e50456d
-0, 64, 64, 1, 126720, 0x44802978
-0, 65, 65, 1, 126720, 0x86e88743
-0, 66, 66, 1, 126720, 0x0b1087d6
-0, 67, 67, 1, 126720, 0xb0227d21
-0, 68, 68, 1, 126720, 0x29d10bd2
-0, 69, 69, 1, 126720, 0x04b43afa
-0, 70, 70, 1, 126720, 0xb48e9698
-0, 71, 71, 1, 126720, 0x75d760fb
-0, 72, 72, 1, 126720, 0xa2ab1fdb
-0, 73, 73, 1, 126720, 0xec30a5ee
-0, 74, 74, 1, 126720, 0xbdab7c8c
-0, 75, 75, 1, 126720, 0xac5c3f2c
-0, 76, 76, 1, 126720, 0xce6350be
-0, 77, 77, 1, 126720, 0xb109657a
-0, 78, 78, 1, 126720, 0x723865a4
-0, 79, 79, 1, 126720, 0xa9869124
-0, 80, 80, 1, 126720, 0xc41af558
-0, 81, 81, 1, 126720, 0xcbe6a402
-0, 82, 82, 1, 126720, 0xb6735ecb
-0, 83, 83, 1, 126720, 0xba3059f2
-0, 84, 84, 1, 126720, 0xe7d63b8d
-0, 85, 85, 1, 126720, 0x8f115906
-0, 86, 86, 1, 126720, 0xaf6a8dcb
-0, 87, 87, 1, 126720, 0xb73e846e
-0, 88, 88, 1, 126720, 0xedd6380f
-0, 89, 89, 1, 126720, 0xd9026acf
-0, 90, 90, 1, 126720, 0xa03a650b
-0, 91, 91, 1, 126720, 0x262765bc
-0, 92, 92, 1, 126720, 0xaaa9ded1
-0, 93, 93, 1, 126720, 0xe4f42665
-0, 94, 94, 1, 126720, 0x78daf760
-0, 95, 95, 1, 126720, 0x3b0c6ef8
-0, 96, 96, 1, 126720, 0xb745df80
-0, 97, 97, 1, 126720, 0x08e57b90
-0, 98, 98, 1, 126720, 0x6f883ab0
-0, 99, 99, 1, 126720, 0x934b4dd5
-0, 100, 100, 1, 126720, 0x762f108f
-0, 101, 101, 1, 126720, 0x91ee0f2b
-0, 102, 102, 1, 126720, 0x9af6e5e8
-0, 103, 103, 1, 126720, 0xdcd95e0a
-0, 104, 104, 1, 126720, 0x22c33a6e
-0, 105, 105, 1, 126720, 0x21c1b7f4
-0, 106, 106, 1, 126720, 0x0a66a1ed
-0, 107, 107, 1, 126720, 0x53fea81b
-0, 108, 108, 1, 126720, 0x597f5567
+0, 45, 45, 1, 126720, 0xc40707da
+0, 46, 46, 1, 126720, 0xcd060dce
+0, 47, 47, 1, 126720, 0xed4024f6
+0, 48, 48, 1, 126720, 0x7decd2b4
+0, 49, 49, 1, 126720, 0xd1d2e730
+0, 50, 50, 1, 126720, 0x77cee457
+0, 51, 51, 1, 126720, 0xe78d02c0
+0, 52, 52, 1, 126720, 0xad0beb29
+0, 53, 53, 1, 126720, 0xc414eea2
+0, 54, 54, 1, 126720, 0x6a15f17d
+0, 55, 55, 1, 126720, 0x516027f6
+0, 56, 56, 1, 126720, 0x4eda9dce
+0, 57, 57, 1, 126720, 0x7d9bdba3
+0, 58, 58, 1, 126720, 0x7aa3d5c0
+0, 59, 59, 1, 126720, 0x7c7a04f9
+0, 60, 60, 1, 126720, 0x3e8fb6cc
+0, 61, 61, 1, 126720, 0xd5474916
+0, 62, 62, 1, 126720, 0xf3f62bab
+0, 63, 63, 1, 126720, 0x2f054987
+0, 64, 64, 1, 126720, 0x974c2e81
+0, 65, 65, 1, 126720, 0xe7e28a97
+0, 66, 66, 1, 126720, 0x45e38b41
+0, 67, 67, 1, 126720, 0x169c7f19
+0, 68, 68, 1, 126720, 0x91d90ee8
+0, 69, 69, 1, 126720, 0xdd653e24
+0, 70, 70, 1, 126720, 0x0da598c4
+0, 71, 71, 1, 126720, 0x687e62cc
+0, 72, 72, 1, 126720, 0x7631232d
+0, 73, 73, 1, 126720, 0xbd1ea826
+0, 74, 74, 1, 126720, 0xb55f7f4b
+0, 75, 75, 1, 126720, 0x923f3fc9
+0, 76, 76, 1, 126720, 0x15515301
+0, 77, 77, 1, 126720, 0x9ee066e5
+0, 78, 78, 1, 126720, 0x7c21664b
+0, 79, 79, 1, 126720, 0x36849100
+0, 80, 80, 1, 126720, 0x08b1f61a
+0, 81, 81, 1, 126720, 0x5bfca6e2
+0, 82, 82, 1, 126720, 0x929f60e3
+0, 83, 83, 1, 126720, 0xa2b55c29
+0, 84, 84, 1, 126720, 0x68bd3ff3
+0, 85, 85, 1, 126720, 0x30db5b29
+0, 86, 86, 1, 126720, 0x00578f9b
+0, 87, 87, 1, 126720, 0x18368642
+0, 88, 88, 1, 126720, 0xbcb83a80
+0, 89, 89, 1, 126720, 0x90f36b72
+0, 90, 90, 1, 126720, 0x85e46522
+0, 91, 91, 1, 126720, 0x2429660a
+0, 92, 92, 1, 126720, 0xf283dfe2
+0, 93, 93, 1, 126720, 0x896b27dc
+0, 94, 94, 1, 126720, 0x5af4f961
+0, 95, 95, 1, 126720, 0x31897085
+0, 96, 96, 1, 126720, 0x441ce33e
+0, 97, 97, 1, 126720, 0x903f8009
+0, 98, 98, 1, 126720, 0xbdf33dba
+0, 99, 99, 1, 126720, 0x8a364f36
+0, 100, 100, 1, 126720, 0xda5513f6
+0, 101, 101, 1, 126720, 0xd60012b3
+0, 102, 102, 1, 126720, 0x67bce7be
+0, 103, 103, 1, 126720, 0x697e6174
+0, 104, 104, 1, 126720, 0xbe3e3e90
+0, 105, 105, 1, 126720, 0xf3e4bba6
+0, 106, 106, 1, 126720, 0x8124a679
+0, 107, 107, 1, 126720, 0x58d1acde
+0, 108, 108, 1, 126720, 0xd8a15ba3
diff --git a/tests/ref/fate/rv30 b/tests/ref/fate/rv30
index df002d948b..70db647985 100644
--- a/tests/ref/fate/rv30
+++ b/tests/ref/fate/rv30
@@ -8,13 +8,13 @@
0, 6, 6, 1, 126720, 0x5e6ff4d7
0, 7, 7, 1, 126720, 0xcc10f4b7
0, 8, 8, 1, 126720, 0x763ab817
-0, 9, 9, 1, 126720, 0xeb6fb8d7
-0, 10, 10, 1, 126720, 0xda71b917
-0, 11, 11, 1, 126720, 0x0967b8f7
+0, 9, 9, 1, 126720, 0xe95fb8d7
+0, 10, 10, 1, 126720, 0xe2b1b917
+0, 11, 11, 1, 126720, 0x11abb8f7
0, 12, 12, 1, 126720, 0x4b62b947
-0, 13, 13, 1, 126720, 0xbb1abbb7
-0, 14, 14, 1, 126720, 0x273fbc37
-0, 15, 15, 1, 126720, 0x16eebbd7
+0, 13, 13, 1, 126720, 0xcaf2bbb7
+0, 14, 14, 1, 126720, 0x2953bc37
+0, 15, 15, 1, 126720, 0x1dd9bbd7
0, 16, 16, 1, 126720, 0x105eb927
0, 17, 17, 1, 126720, 0x7fa3ae27
0, 18, 18, 1, 126720, 0x722e99f7
@@ -28,83 +28,83 @@
0, 26, 26, 1, 126720, 0x6ddaef32
0, 27, 27, 1, 126720, 0xde1bb900
0, 28, 28, 1, 126720, 0xac6c071b
-0, 29, 29, 1, 126720, 0x04e7897c
-0, 30, 30, 1, 126720, 0x5eee050f
-0, 31, 31, 1, 126720, 0xe675be59
+0, 29, 29, 1, 126720, 0x4a9f897c
+0, 30, 30, 1, 126720, 0xd8fa050f
+0, 31, 31, 1, 126720, 0x5d06be59
0, 32, 32, 1, 126720, 0xdc3e0837
-0, 33, 33, 1, 126720, 0x68cfda2b
-0, 34, 34, 1, 126720, 0xe572dfc9
-0, 35, 35, 1, 126720, 0x582fb176
+0, 33, 33, 1, 126720, 0xcac6da2b
+0, 34, 34, 1, 126720, 0x6672dfc9
+0, 35, 35, 1, 126720, 0x7491b176
0, 36, 36, 1, 126720, 0xa9477df0
-0, 37, 37, 1, 126720, 0xbc3cc34f
-0, 38, 38, 1, 126720, 0xcf8cb0e2
-0, 39, 39, 1, 126720, 0xcff1db35
+0, 37, 37, 1, 126720, 0xe976c34f
+0, 38, 38, 1, 126720, 0xdb7ab0e2
+0, 39, 39, 1, 126720, 0x1b42db35
0, 40, 40, 1, 126720, 0xc6e10f9f
-0, 41, 41, 1, 126720, 0x75ae61b6
-0, 42, 42, 1, 126720, 0x12af3119
-0, 43, 43, 1, 126720, 0x85597543
+0, 41, 41, 1, 126720, 0x169d61b6
+0, 42, 42, 1, 126720, 0xc7623119
+0, 43, 43, 1, 126720, 0x5b9b7543
0, 44, 44, 1, 126720, 0x68c27aca
-0, 45, 45, 1, 126720, 0x554fe3e4
-0, 46, 46, 1, 126720, 0x72ecea95
-0, 47, 47, 1, 126720, 0xf4d003d1
-0, 48, 48, 1, 126720, 0x9bf6a605
-0, 49, 49, 1, 126720, 0x5d00b5fe
-0, 50, 50, 1, 126720, 0x93f7b040
-0, 51, 51, 1, 126720, 0x0d6ad154
-0, 52, 52, 1, 126720, 0x4be8b4ea
-0, 53, 53, 1, 126720, 0xe39bba0d
-0, 54, 54, 1, 126720, 0x9c21bad8
-0, 55, 55, 1, 126720, 0xa567f25b
-0, 56, 56, 1, 126720, 0x7a82663a
-0, 57, 57, 1, 126720, 0x72f2a47d
-0, 58, 58, 1, 126720, 0x4f639ebe
-0, 59, 59, 1, 126720, 0xab0fce83
-0, 60, 60, 1, 126720, 0x6cf87d39
-0, 61, 61, 1, 126720, 0x534a10cc
-0, 62, 62, 1, 126720, 0x6bbcf44c
-0, 63, 63, 1, 126720, 0xfdca11d3
-0, 64, 64, 1, 126720, 0x7e58f5a6
-0, 65, 65, 1, 126720, 0x5fd753d8
-0, 66, 66, 1, 126720, 0x0c735615
-0, 67, 67, 1, 126720, 0x2a034ebf
-0, 68, 68, 1, 126720, 0xeaf3dd0b
-0, 69, 69, 1, 126720, 0x0eaf0c1b
-0, 70, 70, 1, 126720, 0xce5e6794
-0, 71, 71, 1, 126720, 0xf27c31c3
-0, 72, 72, 1, 126720, 0xb64af168
-0, 73, 73, 1, 126720, 0x14cf7974
-0, 74, 74, 1, 126720, 0x1c2a513d
-0, 75, 75, 1, 126720, 0xa3f515ab
-0, 76, 76, 1, 126720, 0xcfd62765
-0, 77, 77, 1, 126720, 0xbc513f2a
-0, 78, 78, 1, 126720, 0xbc303fae
-0, 79, 79, 1, 126720, 0x2f8f69b9
-0, 80, 80, 1, 126720, 0x0a22cc69
-0, 81, 81, 1, 126720, 0xd9f67585
-0, 82, 82, 1, 126720, 0x20403001
-0, 83, 83, 1, 126720, 0xf92b2a25
-0, 84, 84, 1, 126720, 0x3c170aad
-0, 85, 85, 1, 126720, 0x3378251f
-0, 86, 86, 1, 126720, 0xb3ed5911
-0, 87, 87, 1, 126720, 0x35d24ef8
-0, 88, 88, 1, 126720, 0x8da30275
-0, 89, 89, 1, 126720, 0xc15a3577
-0, 90, 90, 1, 126720, 0xf2942f53
-0, 91, 91, 1, 126720, 0x44d8304a
-0, 92, 92, 1, 126720, 0xd688a932
-0, 93, 93, 1, 126720, 0x0a24f256
-0, 94, 94, 1, 126720, 0xfab9c45d
-0, 95, 95, 1, 126720, 0x10e939ce
-0, 96, 96, 1, 126720, 0x97fcaa3a
-0, 97, 97, 1, 126720, 0x45464610
-0, 98, 98, 1, 126720, 0xfe2e057d
-0, 99, 99, 1, 126720, 0x0b6718ae
-0, 100, 100, 1, 126720, 0x5284da7b
-0, 101, 101, 1, 126720, 0x23efdc35
-0, 102, 102, 1, 126720, 0xc387b2b3
-0, 103, 103, 1, 126720, 0xc9e92bf1
-0, 104, 104, 1, 126720, 0xfbf20a01
-0, 105, 105, 1, 126720, 0x4d888b2e
-0, 106, 106, 1, 126720, 0xdd0d74df
-0, 107, 107, 1, 126720, 0x49d07aa4
-0, 108, 108, 1, 126720, 0x08382b8e
+0, 45, 45, 1, 126720, 0xa0e4e1c9
+0, 46, 46, 1, 126720, 0xbbdae87e
+0, 47, 47, 1, 126720, 0xe67e00a1
+0, 48, 48, 1, 126720, 0x648ea605
+0, 49, 49, 1, 126720, 0x5becb718
+0, 50, 50, 1, 126720, 0xb79ab1da
+0, 51, 51, 1, 126720, 0x0d52d1dc
+0, 52, 52, 1, 126720, 0x1277b853
+0, 53, 53, 1, 126720, 0xc57cbc83
+0, 54, 54, 1, 126720, 0x2126bdc3
+0, 55, 55, 1, 126720, 0x4c1ef41f
+0, 56, 56, 1, 126720, 0x185f6a2c
+0, 57, 57, 1, 126720, 0xb2b5a7d3
+0, 58, 58, 1, 126720, 0x32d7a26d
+0, 59, 59, 1, 126720, 0x0bffd118
+0, 60, 60, 1, 126720, 0x2eed823a
+0, 61, 61, 1, 126720, 0xc4c0147c
+0, 62, 62, 1, 126720, 0x1f8bf8ac
+0, 63, 63, 1, 126720, 0xfcb715e8
+0, 64, 64, 1, 126720, 0xc3e9fa9c
+0, 65, 65, 1, 126720, 0x9ad8572c
+0, 66, 66, 1, 126720, 0x2800596d
+0, 67, 67, 1, 126720, 0x3caa5094
+0, 68, 68, 1, 126720, 0x6162e000
+0, 69, 69, 1, 126720, 0x18200f2c
+0, 70, 70, 1, 126720, 0x649e699f
+0, 71, 71, 1, 126720, 0x5f513367
+0, 72, 72, 1, 126720, 0x71fbf4a8
+0, 73, 73, 1, 126720, 0x5bff7b97
+0, 74, 74, 1, 126720, 0xbad453d4
+0, 75, 75, 1, 126720, 0x56e6161d
+0, 76, 76, 1, 126720, 0x524f2980
+0, 77, 77, 1, 126720, 0x0589405a
+0, 78, 78, 1, 126720, 0x5c264043
+0, 79, 79, 1, 126720, 0x2394696f
+0, 80, 80, 1, 126720, 0x1aa0cd15
+0, 81, 81, 1, 126720, 0xd6ec7840
+0, 82, 82, 1, 126720, 0xde5531f0
+0, 83, 83, 1, 126720, 0x03a42c3a
+0, 84, 84, 1, 126720, 0xbdee0efb
+0, 85, 85, 1, 126720, 0xa6012736
+0, 86, 86, 1, 126720, 0x448f5ae6
+0, 87, 87, 1, 126720, 0x8a2550c3
+0, 88, 88, 1, 126720, 0x143104e7
+0, 89, 89, 1, 126720, 0x75db363d
+0, 90, 90, 1, 126720, 0x906d2f9d
+0, 91, 91, 1, 126720, 0xfc7b30ab
+0, 92, 92, 1, 126720, 0xd3edaa62
+0, 93, 93, 1, 126720, 0x6267f3fc
+0, 94, 94, 1, 126720, 0x87b6c67f
+0, 95, 95, 1, 126720, 0x84da3b79
+0, 96, 96, 1, 126720, 0x72fbae15
+0, 97, 97, 1, 126720, 0xb8474a80
+0, 98, 98, 1, 126720, 0xbeae088b
+0, 99, 99, 1, 126720, 0x538b1a14
+0, 100, 100, 1, 126720, 0x07bbddcd
+0, 101, 101, 1, 126720, 0x807ddf8f
+0, 102, 102, 1, 126720, 0x325bb46d
+0, 103, 103, 1, 126720, 0xd80c2f2a
+0, 104, 104, 1, 126720, 0xfc1b0dec
+0, 105, 105, 1, 126720, 0x46068ebc
+0, 106, 106, 1, 126720, 0xcd987941
+0, 107, 107, 1, 126720, 0x52f37f2e
+0, 108, 108, 1, 126720, 0xc96931a2