project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 81f194dd69756677cc36ff0827bf970f0f048914 | 0 | static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp)
{
PowerPCCPU *cpu = POWERPC_CPU(dev);
CPUPPCState *env = &cpu->env;
int i;
for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) {
if (env->opcodes[i] != &invalid_handler) {
g_free(env->opcodes[i]);
}
}
}
| 15,194 |
qemu | a2db2a1edd06a50b8a862c654cf993368cf9f1d9 | 0 | static void xen_exit_notifier(Notifier *n, void *data)
{
XenIOState *state = container_of(n, XenIOState, exit);
xc_evtchn_close(state->xce_handle);
xs_daemon_close(state->xenstore);
}
| 15,195 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | static void avc_loopfilter_cb_or_cr_inter_edge_ver_msa(uint8_t *data,
uint8_t bs0, uint8_t bs1,
uint8_t bs2, uint8_t bs3,
uint8_t tc0, uint8_t tc1,
... | 15,196 |
FFmpeg | f98c3ec5c68d14d7c93c2f9775be4583f7905554 | 0 | static int mov_write_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0);
int i, ret, hint_track = 0, tmcd_track = 0;
mov->fc = s;
/* Default mode == MP4 */
mov-... | 15,197 |
FFmpeg | c2657633187e325a439e3297fd9ccd0522ab2e39 | 1 | static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
unsigned int div_blocks[32]; ///< block sizes.
unsigned int c;
unsigned int js_blocks[2];
uint32... | 15,199 |
FFmpeg | 1b9ca38d9d06d319fffd61d27e4eb385d6572ba8 | 1 | int swr_resample(AVResampleContext *c, short *dst, const short *src, int *consumed, int src_size, int dst_size, int update_ctx){
int dst_index, i;
int index= c->index;
int frac= c->frac;
int dst_incr_frac= c->dst_incr % c->src_incr;
int dst_incr= c->dst_incr / c->src_incr;
int compens... | 15,200 |
qemu | f8ed85ac992c48814d916d5df4d44f9a971c5de4 | 1 | static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
{
STM32F205State *s = STM32F205_SOC(dev_soc);
DeviceState *syscfgdev, *usartdev, *timerdev;
SysBusDevice *syscfgbusdev, *usartbusdev, *timerbusdev;
qemu_irq *pic;
Error *err = NULL;
int i;
MemoryRegion *system_me... | 15,202 |
FFmpeg | 92e483f8ed70d88d4f64337f65bae212502735d4 | 1 | static int cmp_int(const void *p1, const void *p2)
{
int left = *(const int *)p1;
int right = *(const int *)p2;
return ((left > right) - (left < right));
}
| 15,203 |
FFmpeg | dba5b06ead6bbec8fd1207d778240188182c8361 | 1 | static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
{
const CodecMime *mime = ff_id3v2_mime_tags;
enum CodecID id = CODEC_ID_NONE;
uint8_t mimetype[64], *desc = NULL, *data = NULL;
AVIOContext *pb = NULL;
AVStream *st;
int type, width, height;
int len, ret ... | 15,205 |
qemu | 82a41186941c419afde977f477f19c545b40c1c5 | 1 | void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, Error **errp)
{
error_setg(errp, "AioContext polling is not implemented on Windows");
}
| 15,207 |
qemu | 1e356fc14beaa3ece6c0e961bd479af58be3198b | 1 | static void host_memory_backend_set_prealloc(Object *obj, bool value,
Error **errp)
{
Error *local_err = NULL;
HostMemoryBackend *backend = MEMORY_BACKEND(obj);
if (backend->force_prealloc) {
if (value) {
error_setg(errp,
... | 15,208 |
FFmpeg | 4d7c71c36467331f1e0c0f17af9f371d33308a9c | 1 | void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
{
AVPacketList **next_point, *this_pktl;
this_pktl = av_mallocz(sizeof(AVPacketList));
this_pktl->pkt= *pkt;
pkt->destruct= NULL; ... | 15,210 |
qemu | ac97393dc7c4761af6104fb8fca5f600899f687b | 1 | static void read_partition(uint8_t *p, struct partition_record *r)
{
r->bootable = p[0];
r->start_head = p[1];
r->start_cylinder = p[3] | ((p[2] << 2) & 0x0300);
r->start_sector = p[2] & 0x3f;
r->system = p[4];
r->end_head = p[5];
r->end_cylinder = p[7] | ((p[6] << 2) & 0x300);
... | 15,211 |
FFmpeg | 5a5c1b244281c3edcffca322b0c664ed620b1e24 | 1 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
{
AVFrame *frame = data;
DxaDecContext * const c = avctx->priv_data;
uint8_t *outptr, *srcptr, *tmpptr;
unsigned long dsize;
int i, j, compr, ret;
int stride;
int pc = 0;
GetByteContext g... | 15,212 |
qemu | b8e23926c568f2e963af39028b71c472e3023793 | 1 | static void virtio_gpu_resource_destroy(VirtIOGPU *g,
struct virtio_gpu_simple_resource *res)
{
pixman_image_unref(res->image);
QTAILQ_REMOVE(&g->reslist, res, next);
g->hostmem -= res->hostmem;
g_free(res);
} | 15,213 |
qemu | 874adf45dbfbae2810423527d777ba37bc5ca974 | 1 | void virtio_save(VirtIODevice *vdev, QEMUFile *f)
{
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
uint32_t guest_features_lo = (vdev->guest_features & 0xffffffff);
int i;
if (k-... | 15,214 |
qemu | 392808b49b6aee066d0c1d200e72fc3dc11c9d0f | 1 | static void virtio_blk_dma_restart_cb(void *opaque, int running,
RunState state)
{
VirtIOBlock *s = opaque;
if (!running)
return;
if (!s->bh) {
s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s);
qemu_bh_schedule(s->bh);
}
}
| 15,215 |
FFmpeg | 2f3b028c7117e03267ea7f88d0d612e70f1afc06 | 1 | static char *json_escape_str(const char *s)
{
static const char json_escape[] = {'"', '\\', '\b', '\f', '\n', '\r', '\t', 0};
static const char json_subst[] = {'"', '\\', 'b', 'f', 'n', 'r', 't', 0};
char *ret, *p;
int i, len = 0;
// compute the length of the escaped string
for (i... | 15,216 |
FFmpeg | 8108551a5c4c4c9696582c73d000f94b12cd95a5 | 0 | static int gif_image_write_header(ByteIOContext *pb,
int width, int height, uint32_t *palette)
{
int i;
unsigned int v;
put_tag(pb, "GIF");
put_tag(pb, "89a");
put_le16(pb, width);
put_le16(pb, height);
put_byte(pb, 0xf7); /* flags: global clut... | 15,218 |
FFmpeg | 0f64b6cd22411f574cbc75cab3b6db7dba023ed6 | 0 | static int rscc_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
RsccContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
GetByteContext tiles_gbc;
AVFrame *frame = data;
const uint8_t *pixels, *raw;
uint... | 15,220 |
FFmpeg | 7c9d2ad45f4e46ad2c3b2e93051efbe1e0d0529e | 0 | static int parse_frame_header(DCACoreDecoder *s)
{
DCACoreFrameHeader h = { 0 };
int err = avpriv_dca_parse_core_frame_header(&s->gb, &h);
if (err < 0) {
switch (err) {
case DCA_PARSE_ERROR_DEFICIT_SAMPLES:
av_log(s->avctx, AV_LOG_ERROR, "Deficit samples are not supporte... | 15,221 |
FFmpeg | 56ee3f9de7b9f6090d599a27d33a392890a2f7b8 | 0 | static int insert_trim(OutputStream *ost, AVFilterContext **last_filter, int *pad_idx)
{
OutputFile *of = output_files[ost->file_index];
AVFilterGraph *graph = (*last_filter)->graph;
AVFilterContext *ctx;
const AVFilter *trim;
const char *name = ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO... | 15,223 |
FFmpeg | 1ec83d9a9e472f485897ac92bad9631d551a8c5b | 0 | static int add_doubles_metadata(const uint8_t **buf, int count,
const char *name, const char *sep,
TiffContext *s)
{
char *ap;
int i;
double *dp = av_malloc(count * sizeof(double));
if (!dp)
return AVERROR(ENOMEM);
fo... | 15,224 |
qemu | 441692ddd8321d5e0f09b163e86410e578d87236 | 1 | static inline int onenand_load_spare(OneNANDState *s, int sec, int secn,
void *dest)
{
uint8_t buf[512];
if (s->blk_cur) {
if (blk_read(s->blk_cur, s->secs_cur + (sec >> 5), buf, 1) < 0) {
return 1;
}
memcpy(dest, buf + ((sec & 31) << 4), secn << 4);... | 15,228 |
FFmpeg | d4be08e0c9fc9ed2862e952a489ef6a8943b5e5d | 1 | X264_init(AVCodecContext *avctx)
{
X264Context *x4 = avctx->priv_data;
x264_param_default(&x4->params);
x4->params.pf_log = X264_log;
x4->params.p_log_private = avctx;
x4->params.i_keyint_max = avctx->gop_size;
x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
x4->params.rc.i_v... | 15,229 |
FFmpeg | 8b830ee9a26d47b138f12a82085cdb372f407f1e | 1 | int configure_filtergraph(FilterGraph *fg)
{
AVFilterInOut *inputs, *outputs, *cur;
int ret, i, simple = !fg->graph_desc;
const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
fg->graph_desc;
avfilter_graph_free(&fg->graph);
if (!(fg->graph ... | 15,230 |
FFmpeg | 065ee1ec325ed7d34acf13d0bf319c1c6b457e21 | 1 | inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2,
int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter,
int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode,
int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter,
... | 15,231 |
qemu | 3e36aba757f76673007a80b3cd56a4062c2e3462 | 1 | static int mp_user_setxattr(FsContext *ctx, const char *path, const char *name,
void *value, size_t size, int flags)
{
char *buffer;
int ret;
if (strncmp(name, "user.virtfs.", 12) == 0) {
/*
* Don't allow fetch of user.virtfs namesapce
* in cas... | 15,232 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_tlbiva(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
t0 = tcg_temp_new();
gen_addr_reg_index(ctx, t0... | 15,233 |
FFmpeg | d574e22659bd51cdf16723a204fef65a9e783f1d | 0 | static void hdcd_reset(hdcd_state_t *state, unsigned rate)
{
int i;
state->window = 0;
state->readahead = 32;
state->arg = 0;
state->control = 0;
state->running_gain = 0;
state->sustain = 0;
state->sustain_reset = rate * 10;
state->code_counterA = 0;
state->cod... | 15,234 |
FFmpeg | 4982130d5a7babcb4b2e208fca2c745de7e10658 | 0 | static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
{
AResampleContext *aresample = inlink->dst->priv;
const int n_in = insamplesref->nb_samples;
int64_t delay;
int n_out = n_in * aresample->ratio + 32;
AVFilterLink *const outlink = inlink->dst->outputs[0];
AVFrame... | 15,235 |
FFmpeg | 6e249466cc6bd5b17d6e8cbd9a84a636cc92fd60 | 0 | int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVMuxContext *mov = s->priv_data;
AVIOContext *pb = s->pb;
MOVTrack *trk = &mov->tracks[pkt->stream_index];
AVCodecContext *enc = trk->enc;
unsigned int samples_in_chunk = 0;
int size = pkt->size, ret = 0;
uint8_t *reforma... | 15,236 |
FFmpeg | 851ded8918c977d8160c6617b69604f758cabf50 | 0 | static int decode_cabac_mb_chroma_pre_mode( H264Context *h) {
const int mba_xy = h->left_mb_xy[0];
const int mbb_xy = h->top_mb_xy;
int ctx = 0;
/* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */
if( h->slice_table[mba_xy] == h->slice_num && h->ch... | 15,237 |
FFmpeg | b7c96769c52a312c6f6abe43f5d8c83701118a0b | 0 | static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
AacPsyContext *pctx;
float bark;
int i, j, g, start;
float prev, minscale, minath;
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
pctx = (AacPsyContext*) ctx->model_priv_data;
minath = ath(3410, ATH_ADD);
for (j... | 15,238 |
qemu | 34779e8c3991f7fcd74b2045478abcef67dbeb15 | 1 | static void test_tco_second_timeout_reset(void)
{
TestData td;
const uint16_t ticks = TCO_SECS_TO_TICKS(16);
QDict *ad;
td.args = "-watchdog-action reset";
td.noreboot = false;
test_init(&td);
stop_tco(&td);
clear_tco_status(&td);
reset_on_second_timeout(true);
set... | 15,240 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static void e1000e_macreg_write(e1000e_device *d, uint32_t reg, uint32_t val)
{
qpci_io_writel(d->pci_dev, d->mac_regs + reg, val);
}
| 15,241 |
qemu | e907746266721f305d67bc0718795fedee2e824c | 1 | static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction)
{
FDrive *cur_drv = get_cur_drv(fdctrl);
if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {
/* Command parameters done */
if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {
fdctrl->fifo[0] = fdct... | 15,242 |
qemu | 4d1628e832dfc6ec02b0d196f6cc250aaa7bf3b3 | 1 | uint64_t helper_addqv(CPUAlphaState *env, uint64_t op1, uint64_t op2)
{
uint64_t tmp = op1;
op1 += op2;
if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) {
arith_excp(env, GETPC(), EXC_M_IOV, 0);
}
return op1;
}
| 15,243 |
qemu | 3e831b40e015ba34dfb55ff11f767001839425ff | 1 | pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s)
{
PVSCSICmdDescSetupMsgRing *rc =
(PVSCSICmdDescSetupMsgRing *) s->curr_cmd_data;
trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_MSG_RING");
if (!s->use_msg) {
return PVSCSI_COMMAND_PROCESSING_FAILED;
}
if (s->rings_info_valid... | 15,244 |
qemu | 6d0b908a628a7086fa855c68b217cc1e2a5c4c19 | 1 | dispatcher_wait(Dispatcher *dispr, uint32_t timeout)
{
struct timeval tv;
tv.tv_sec = timeout / 1000000;
tv.tv_usec = timeout % 1000000;
fd_set fdset = dispr->fdset;
/* wait until some of sockets become readable. */
int rc = select(dispr->max_sock + 1, &fdset, 0, 0, &tv);
if (r... | 15,246 |
qemu | 9ac228e02cf16202547e7025ef300369e0db7781 | 1 | int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res)
{
if (bs->drv->bdrv_check == NULL) {
return -ENOTSUP;
}
memset(res, 0, sizeof(*res));
res->corruptions = bs->drv->bdrv_check(bs);
return res->corruptions < 0 ? res->corruptions : 0;
}
| 15,247 |
FFmpeg | 8fd8a48263ff1437f9d02d7e78dc63efb9b5ed3a | 1 | static int nsv_parse_NSVf_header(AVFormatContext *s)
{
NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int av_unused file_size;
unsigned int size;
int64_t duration;
int strings_size;
int table_entries;
int table_entries_used;
av_dlog(s, "%s()\n", __FUNCT... | 15,248 |
FFmpeg | 55a727383bab266b757b642aabaa2b066c14e7c7 | 0 | static int flac_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
FLACContext *s = avctx->priv_data;
int tmp = 0, i, j = 0, input_buf_size = 0;
int16_t *samples_16 = data;
int32_t *samples_32... | 15,250 |
FFmpeg | 47c93657249f1a4bc8a7aaf2f9f3a33510bee38c | 0 | static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
CFHDContext *s = avctx->priv_data;
GetByteContext gb;
ThreadFrame frame = { .f = data };
AVFrame *pic = data;
int ret = 0, i, j, planes, plane, got_buffer = 0;
int16_t *coe... | 15,251 |
FFmpeg | 6a786b15c34765ec00be3cd808dafbb041fd5881 | 0 | static void vc1_inv_trans_8x8_altivec(DCTELEM block[64])
{
vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
vector signed int s8, s9, sA, sB, sC, sD, sE, sF;
vector signed int t0, t1, t2, t3, t4, t5, t6, t7;
const vector sign... | 15,253 |
FFmpeg | e2742d6ad69595fd2af36adf0883e37701307f52 | 1 | static int decode_tilehdr(WmallDecodeCtx *s)
{
uint16_t num_samples[WMALL_MAX_CHANNELS] = { 0 }; /* sum of samples for all currently known subframes of a channel */
uint8_t contains_subframe[WMALL_MAX_CHANNELS]; /* flag indicating if a channel contains the current subframe */
int channels_for_cur_sub... | 15,254 |
qemu | 6ab3fc32ea640026726bc5f9f4db622d0954fb8a | 1 | uart_write(void *opaque, hwaddr addr,
uint64_t val64, unsigned int size)
{
XilinxUARTLite *s = opaque;
uint32_t value = val64;
unsigned char ch = value;
addr >>= 2;
switch (addr)
{
case R_STATUS:
hw_error("write to UART STATUS?\n");
break;
... | 15,255 |
qemu | 8190483196148f765c65785876f7b893d64b6cdd | 1 | static CharDriverState *net_vhost_parse_chardev(const NetdevVhostUserOptions *opts)
{
CharDriverState *chr = qemu_chr_find(opts->chardev);
VhostUserChardevProps props;
if (chr == NULL) {
error_report("chardev \"%s\" not found", opts->chardev);
return NULL;
}
/* inspect ch... | 15,256 |
FFmpeg | 7effbee66cf457c62f795d9b9ed3a1110b364b89 | 1 | static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, size;
// AVStream *st = s->streams[0];
size= MP3_PACKET_SIZE;
ret= av_get_packet(s->pb, pkt, size);
pkt->stream_index = 0;
if (ret <= 0) {
if(ret<0)
return ret;
return AVERROR... | 15,257 |
FFmpeg | 15ee419b7abaf17f8c662c145fe93d3dbf43282b | 1 | static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVFrame *const p = data;
int compressed, xmin, ymin, xmax, ymax;
unsigned int w, h, bits_per_pixe... | 15,259 |
FFmpeg | bda5b6627a558cf10c4d09eeff264289a1370cc1 | 0 | static int mkv_write_trailer(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *pb = s->pb;
int64_t currentpos, cuespos;
int ret;
// check if we have an audio packet cached
if (mkv->cur_audio_pkt.size > 0) {
ret = mkv_write_packet_internal(s, &mkv->cur_a... | 15,261 |
FFmpeg | f19af812a32c1398d48c3550d11dbc6aafbb2bfc | 1 | int is_adx(const unsigned char *buf,size_t bufsize)
{
int offset;
if (buf[0]!=0x80) return 0;
offset = (read_long(buf)^0x80000000)+4;
if (bufsize<offset || memcmp(buf+offset-6,"(c)CRI",6)) return 0;
return offset;
}
| 15,263 |
qemu | 2b21233061696feed434317a70e0a8b74f956ec8 | 1 | rfc3986_parse_port(URI *uri, const char **str)
{
const char *cur = *str;
if (ISA_DIGIT(cur)) {
if (uri != NULL)
uri->port = 0;
while (ISA_DIGIT(cur)) {
if (uri != NULL)
uri->port = uri->port * 10 + (*cur - '0');
cur++;
}
*str = cur;
return(0);
}
return(1);
}
| 15,265 |
FFmpeg | 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 | 1 | static void encode_422_bitstream(HYuvContext *s, int count){
int i;
count/=2;
if(s->flags&CODEC_FLAG_PASS1){
for(i=0; i<count; i++){
s->stats[0][ s->temp[0][2*i ] ]++;
s->stats[1][ s->temp[1][ i ] ]++;
s->stats[0][ s->temp[0][2*i+1] ]++;
... | 15,266 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int usb_net_handle_dataout(USBNetState *s, USBPacket *p)
{
int ret = p->len;
int sz = sizeof(s->out_buf) - s->out_ptr;
struct rndis_packet_msg_type *msg =
(struct rndis_packet_msg_type *) s->out_buf;
uint32_t len;
#ifdef TRAFFIC_DEBUG
fprintf(stderr, "usbnet: data out le... | 15,267 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn)
{
int32_t disp21, disp16, disp12 __attribute__((unused));
uint16_t fn11;
uint8_t opc, ra, rb, rc, fpfn, fn7, lit;
bool islit, real_islit;
TCGv va, vb, vc, tmp, tmp2;
TCGv_i32 t32;
DisasJumpType ret;
/* Decode... | 15,268 |
qemu | f3c75d42adbba553eaf218a832d4fbea32c8f7b8 | 1 | static target_ulong h_protect(PowerPCCPU *cpu, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
CPUPPCState *env = &cpu->env;
target_ulong flags = args[0];
target_ulong pte_index = args[1];
target_ulong avpn = args[2];
hwaddr hpte;
target_... | 15,269 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void do_op_602_mfrom (void)
{
if (likely(T0 < 602)) {
#ifdef USE_MFROM_ROM_TABLE
#include "mfrom_table.c"
T0 = mfrom_ROM_table[T0];
#else
double d;
/* Extremly decomposed:
* -T0 / 256
* T0 = 256 * log10(10 + 1.0) + 0.5
*/
... | 15,270 |
FFmpeg | 9bd854b1ff342f82efa6d2ad4e8fefddce5fa731 | 1 | static int mpc8_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MPCContext *c = avctx->priv_data;
GetBitContext gb2, *gb = &gb2;
int i, j,... | 15,271 |
qemu | f3e4ce4af336f2ea306fa0f40ec1a5149864ca8c | 1 | static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp)
{
BackupBlockJob *s = container_of(job, BackupBlockJob, common);
if (speed < 0) {
error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_... | 15,272 |
qemu | 33876dfad64bc481f59c5e9ccf60db78624c4b93 | 1 | static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
struct XenDevOps *ops)
{
struct XenDevice *xendev;
char *dom0;
xendev = xen_be_find_xendev(type, dom, dev);
if (xendev) {
return xendev;
}
/* init new xe... | 15,273 |
FFmpeg | 0c800b27611cadd64f46fd1bbd9dc8bb87fe168b | 1 | int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
AVPacket *avpkt,
const AVFrame *frame,
int *got_packet_ptr)
{
AVFrame *extended_frame = NULL;
AVFrame *pa... | 15,274 |
FFmpeg | 2b31a9c613f95383d5106f8c1cbcee8eb291090f | 1 | static int iff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
IffDemuxContext *iff = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st = s->streams[0];
int ret;
int64_t pos = avio_tell(pb);
if (pos >= iff->body_end)
return AVERROR_EOF;
if ... | 15,275 |
qemu | f897bf751fbd95e4015b95d202c706548586813a | 1 | static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f)
{
VirtIOBlock *s = VIRTIO_BLK(vdev);
VirtIOBlockReq *req = s->rq;
while (req) {
qemu_put_sbyte(f, 1);
qemu_put_buffer(f, (unsigned char *)req->elem,
sizeof(VirtQueueElement));
req = ... | 15,276 |
FFmpeg | 2da0d70d5eebe42f9fcd27ee554419ebe2a5da06 | 1 | static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, long dstW, long dstY)
{
#ifdef HAVE_MMX
long dummy=0;
if(c->flags & SWS_ACCURATE_RND){
swit... | 15,277 |
qemu | 3a330134b3effa3494051763b38f12a24715d53a | 1 | static void virtio_net_save(QEMUFile *f, void *opaque)
{
VirtIONet *n = opaque;
virtio_save(&n->vdev, f);
qemu_put_buffer(f, n->mac, ETH_ALEN);
qemu_put_be32(f, n->tx_timer_active);
qemu_put_be32(f, n->mergeable_rx_bufs);
qemu_put_be16(f, n->status);
qemu_put_byte(f, n->promisc);... | 15,278 |
FFmpeg | 29112db8c0f65886e69cbbd6f4e5c44d2d14d238 | 1 | static int set_palette(AVFrame * frame, const uint8_t * palette_buffer, int buf_size)
{
uint32_t * palette = (uint32_t *)frame->data[1];
int a;
if (buf_size < 256*3)
return AVERROR_INVALIDDATA;
for(a = 0; a < 256; a++){
palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4;
}
... | 15,280 |
FFmpeg | 4d388c0cd05dd4de545e8ea333ab4de7d67ad12d | 1 | static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel)
{
int i[2] = { 0 };
int index = 0;
while (i[0] < len || i[1] < len) {
while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))
i[0]++;
while (i[1] < len && !(in[i[1]] && (in[i[1... | 15,281 |
qemu | 21ef45d71221b4577330fe3aacfb06afad91ad46 | 1 | static void vnc_init_timer(VncDisplay *vd)
{
vd->timer_interval = VNC_REFRESH_INTERVAL_BASE;
if (vd->timer == NULL && !QTAILQ_EMPTY(&vd->clients)) {
vd->timer = qemu_new_timer_ms(rt_clock, vnc_refresh, vd);
vnc_dpy_resize(dcl, vd->ds);
vnc_refresh(vd);
}
}
| 15,282 |
FFmpeg | bcaf64b605442e1622d16da89d4ec0e7730b8a8c | 0 | static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
int n, i, ch, st, pkt_size, ret;
const int16_t *samples;
int16_t **samples_p;
uint8_t *dst;
ADPCMEncodeContext *c = avctx->priv_data;
uint8_t *... | 15,283 |
qemu | 632314c49ce20ee9c974f07544d9125fbbbfbe1b | 1 | static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu,
TranslationBlock *tb,
int search_pc)
{
struct DisasContext ctx, *dc = &ctx;
uint16_t *gen_opc_end;
uint32_t pc_start;
int j, k;
... | 15,284 |
FFmpeg | 803e82276b3716bf6012ec69e8854dae14a4fd2b | 1 | static int ism_write_header(AVFormatContext *s)
{
SmoothStreamingContext *c = s->priv_data;
int ret = 0, i;
AVOutputFormat *oformat;
mkdir(s->filename, 0777);
oformat = av_guess_format("ismv", NULL, NULL);
if (!oformat) {
ret = AVERROR_MUXER_NOT_FOUND;
goto fail;
... | 15,285 |
FFmpeg | 2d66fc543b01995d6146fc132a778d3e722ca665 | 1 | static void gradfun_filter_line_mmxext(uint8_t *dst, uint8_t *src, uint16_t *dc,
int width, int thresh,
const uint16_t *dithers)
{
intptr_t x;
if (width & 3) {
x = width & ~3;
ff_gradfun_filter_line_c(dst + x, s... | 15,286 |
qemu | 18775ff32697ab6e1fd47989673bf1de54d0d942 | 1 | static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
{
bdrv_refresh_filename(bs->backing->bs);
pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
bs->backing->bs->filename);
| 15,287 |
qemu | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 | 1 | static CharDriverState *qemu_chr_open_file_out(QemuOpts *opts)
{
int fd_out;
TFR(fd_out = open(qemu_opt_get(opts, "path"),
O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));
if (fd_out < 0)
return NULL;
return qemu_chr_open_fd(-1, fd_out);
}
| 15,289 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx)
{
SchroBuffer *enc_buf = NULL;
int next_pu_offset = 0;
unsigned char *in_buf;
if (parse_ctx->buf_size < 13 ||
parse_ctx->buf[0] != 'B' ||
parse_ctx->buf[1] != 'B' ||
parse_ctx->buf[2] != 'C' ||
... | 15,291 |
FFmpeg | 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 | 1 | static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){
int i, mb_x, mb_y;
uint16_t buffer[2048][4];
int left[3], top[3], topleft[3];
const int linesize= s->linesize[0];
const int mask= (1<<s->bits)-1;
for(i=0; i<3; i++){
buffer[0][i]= 1 ... | 15,292 |
FFmpeg | e72f3d10f64f5c65a67aa21dcc79a85ee55e912e | 0 | static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block,
int n, int qscale, int *overflow)
{
const uint8_t *scantable= ctx->intra_scantable.scantable;
const int *qmat = ctx->q_intra_matrix[qscale];
int last_non_zero = 0;
ctx->dsp.fdct(block);
... | 15,293 |
FFmpeg | 5b4da8a38a5ed211df9504c85ce401c30af86b97 | 0 | static int estimate_motion_b(MpegEncContext *s, int mb_x, int mb_y,
int16_t (*mv_table)[2], int ref_index, int f_code)
{
MotionEstContext * const c= &s->me;
int mx = 0, my = 0, dmin = 0;
int P[10][2];
const int shift= 1+s->quarter_sample;
const int mot_stride = s-... | 15,294 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int XAVS_close(AVCodecContext *avctx)
{
XavsContext *x4 = avctx->priv_data;
av_freep(&avctx->extradata);
av_free(x4->sei);
av_freep(&x4->pts_buffer);
if (x4->enc)
xavs_encoder_close(x4->enc);
av_frame_free(&avctx->coded_frame);
return 0;
}
| 15,295 |
qemu | 7e30e6a6746b417c7e0dbc9af009560fbb63f336 | 1 | int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed)
{
int ret = 0;
VHDXHeader *hdr;
VHDXLogSequence logs = { 0 };
hdr = s->headers[s->curr_header];
*flushed = false;
/* s->log.hdr is freed in vhdx_close() */
if (s->log.hdr == NULL) {
s->log.hdr = ... | 15,297 |
qemu | d4c64800bbe1332328695a551b84ae68590c90fd | 1 | QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
QCryptoCipherMode mode,
const uint8_t *key, size_t nkey,
Error **errp)
{
QCryptoCipher *cipher;
QCryptoCipherNettle *ctx;
uint8_t *rfbkey... | 15,298 |
FFmpeg | da048c6d24729d3bab6ccb0ac340ea129e3e88d5 | 1 | static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "minf");
if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO)
mov_write_vmhd_tag(pb);
else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
... | 15,299 |
FFmpeg | 76167140a91c081a0cf9d0abcaa4da18d1bacadb | 1 | static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
{
const AVPixFmtDescriptor *desc;
mfxSession session = NULL;
int iopattern = 0;
mfxVideoParam param = { { 0 } };
int frame_width = avctx->coded_width;
int frame_height = avctx->coded_height;
int ret;
desc = av_p... | 15,300 |
FFmpeg | f707a5ebba734597b1ff0810931b55b630077ab3 | 1 | static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,
const uint8_t *table)
{
int i;
int j;
int out = 0;
int c;
int t;
/* first line contain absolute values, other lines contain deltas */
while (out < width)... | 15,302 |
qemu | 062ba099e01ff1474be98c0a4f3da351efab5d9d | 1 | int kvm_arm_sync_mpstate_to_kvm(ARMCPU *cpu)
{
if (cap_has_mp_state) {
struct kvm_mp_state mp_state = {
.mp_state =
cpu->powered_off ? KVM_MP_STATE_STOPPED : KVM_MP_STATE_RUNNABLE
};
int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state);
if (... | 15,303 |
qemu | 344dc16fae0cb6a011aa5befffc8e7d520b11d5d | 1 | void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
bool assign, bool set_handler)
{
if (assign && set_handler) {
aio_set_event_notifier(ctx, &vq->host_notifier, true,
virtio_queue_host_notifier_r... | 15,304 |
FFmpeg | c3f87f7545d42520921bc448b9fbd7324c574e49 | 1 | av_cold int swr_init(struct SwrContext *s){
int ret;
char l1[1024], l2[1024];
clear_context(s);
if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){
av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt);
return AVERROR(EINVAL);
}
if(s->out_s... | 15,305 |
FFmpeg | a52f443714b5c2a40ed272d8445f4c39220a4b69 | 1 | static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_num)
{
MpegEncContext *s = &v->s;
int mb_cbp = v->cbp[s->mb_x - s->mb_stride],
block_cbp = mb_cbp >> (block_num * 4), bottom_cbp,
mb_is_intra = v->is_intra[s->mb_x - s->mb_stride],
... | 15,306 |
FFmpeg | 0c33ceda91dd646414a2e0ec832bada5acb6b762 | 0 | int main(void)
{
int x = 0;
int i, j;
AVLFG state;
av_lfg_init(&state, 0xdeadbeef);
for (j = 0; j < 10000; j++) {
START_TIMER
for (i = 0; i < 624; i++) {
//av_log(NULL, AV_LOG_ERROR, "%X\n", av_lfg_get(&state));
x += av_lfg_get(&state);
}
... | 15,307 |
FFmpeg | fb7a2bf6956173eda6f9caceef8599fa4f83500d | 0 | enum CodecID codec_get_id(const CodecTag *tags, unsigned int tag)
{
while (tags->id != 0) {
if( toupper((tag >> 0)&0xFF) == toupper((tags->tag >> 0)&0xFF)
&& toupper((tag >> 8)&0xFF) == toupper((tags->tag >> 8)&0xFF)
&& toupper((tag >>16)&0xFF) == toupper((tags->tag >>16)&0xFF)
... | 15,308 |
FFmpeg | 1acd7d594c15aa491729c837ad3519d3469e620a | 0 | static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
pixel *pix = (pixel*)_pix;
const dctcoef *block = (const dctcoef*)_block;
stride >>= sizeof(pixel)-1;
pix -= stride;
for(i=0; i<4; i++){
... | 15,309 |
qemu | 523a59f596a3e62f5a28eb171adba35e71310040 | 1 | static void pci_bridge_cleanup_alias(MemoryRegion *alias,
MemoryRegion *parent_space)
{
memory_region_del_subregion(parent_space, alias);
memory_region_destroy(alias);
}
| 15,310 |
FFmpeg | 4776c61424fa32394e251e9769e1ad2c2fa55598 | 1 | static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
{
const AVHWAccel *hwaccel = avctx->hwaccel;
int override_dimensions = 1;
int ret;
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if ((ret = av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PI... | 15,313 |
qemu | 3a8f2a9ce51036ab2d25bcc31114b5cbb72ab44b | 1 | void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size)
{
assert(!(size & (size - 1))); /* power of 2 */
assert(size >= PCIE_MMCFG_SIZE_MIN);
assert(size <= PCIE_MMCFG_SIZE_MAX);
e->size = size;
memory_region_init_io(&e->mmio, OBJECT(e), &pcie_mmcfg_ops, e,
... | 15,314 |
qemu | 4e47e39ab0ded72c0af174131ecf49d588d66c12 | 1 | static void update_sse_status(CPUX86State *env)
{
int rnd_type;
/* set rounding mode */
switch (env->mxcsr & SSE_RC_MASK) {
default:
case SSE_RC_NEAR:
rnd_type = float_round_nearest_even;
break;
case SSE_RC_DOWN:
rnd_type = float_round_down;
break;
... | 15,315 |
FFmpeg | b39f872a41b92a31589052c8f914c5b52f206fd0 | 1 | static int adts_aac_probe(AVProbeData *p)
{
int max_frames = 0, first_frames = 0;
int fsize, frames;
uint8_t *buf0 = p->buf;
uint8_t *buf2;
uint8_t *buf;
uint8_t *end = buf0 + p->buf_size - 7;
buf = buf0;
for(; buf < end; buf= buf2+1) {
buf2 = buf;
for(fr... | 15,316 |
qemu | f69a8bde29354493ff8aea64cc9cb3b531d16337 | 1 | static int qio_channel_websock_handshake_read(QIOChannelWebsock *ioc,
Error **errp)
{
char *handshake_end;
ssize_t ret;
/* Typical HTTP headers from novnc are 512 bytes, so limiting
* total header size to 4096 is easily enough. */
size_t want = 4... | 15,317 |
FFmpeg | 95891804bf300b266aa5328f1c338c046720e658 | 1 | static int decode_init_mp3on4(AVCodecContext * avctx)
{
MP3On4DecodeContext *s = avctx->priv_data;
MPEG4AudioConfig cfg;
int i;
if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) {
av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n");
return -1;
... | 15,318 |
FFmpeg | 5e53486545726987ab4482321d4dcf7e23e7652f | 0 | void avdevice_register_all(void)
{
static int inited;
if (inited)
return;
inited = 1;
/* devices */
REGISTER_MUXDEMUX (AUDIO_BEOS, audio_beos);
REGISTER_DEMUXER (BKTR, bktr);
REGISTER_DEMUXER (DV1394, dv1394);
REGISTER_MUXDEMUX (OSS, oss);
REGISTER_DEMUXER (... | 15,320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.